This commit is contained in:
franck
2013-09-17 13:50:23 +02:00
66 changed files with 5775 additions and 1380 deletions

View File

@@ -0,0 +1,98 @@
<?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\Action;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\CartEvent;
use Thelia\Core\Event\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\ProductPrice;
use Thelia\Model\ProductPriceQuery;
use Thelia\Model\CartItem;
use Thelia\Model\CartItemQuery;
use Thelia\Model\ConfigQuery;
/**
*
* Class Order
* @package Thelia\Action
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class Order extends BaseAction implements EventSubscriberInterface
{
/**
* @param \Thelia\Core\Event\OrderEvent $event
*/
public function setDeliveryAddress(OrderEvent $event)
{
$order = $event->getOrder();
$order->chosenDeliveryAddress = $event->getDeliveryAddress();
$event->setOrder($order);
}
/**
* @param \Thelia\Core\Event\OrderEvent $event
*/
public function setDeliveryModule(OrderEvent $event)
{
$order = $event->getOrder();
$deliveryAddress = $event->getDeliveryAddress();
$order->setDeliveryModuleId($event->getDeliveryModule());
$event->setOrder($order);
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
* The array keys are event names and the value can be:
*
* * The method name to call (priority defaults to 0)
* * An array composed of the method name to call and the priority
* * An array of arrays composed of the method names to call and respective
* priorities, or 0 if unset
*
* For instance:
*
* * array('eventName' => 'methodName')
* * array('eventName' => array('methodName', $priority))
* * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
*
* @return array The event names to listen to
*
* @api
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::ORDER_SET_DELIVERY_ADDRESS => array("setDeliveryAddress", 128),
TheliaEvents::ORDER_SET_DELIVERY_MODULE => array("setDeliveryModule", 128),
);
}
}

View File

@@ -17,6 +17,11 @@
<tag name="kernel.event_subscriber"/>
</service>
<service id="thelia.action.order" class="Thelia\Action\Order">
<argument type="service" id="service_container"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="thelia.action.customer" class="Thelia\Action\Customer">
<argument type="service" id="service_container"/>
<tag name="kernel.event_subscriber"/>

View File

@@ -58,6 +58,8 @@
<form name="thelia.cart.add" class="Thelia\Form\CartAdd"/>
<form name="thelia.order.delivery" class="Thelia\Form\OrderDelivery"/>
<form name="thelia.admin.config.creation" class="Thelia\Form\ConfigCreationForm"/>
<form name="thelia.admin.config.modification" class="Thelia\Form\ConfigModificationForm"/>

View File

@@ -97,6 +97,7 @@
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">cart</default>
</route>
<route id="cart.add.process" path="/cart/add">
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
</route>
@@ -111,6 +112,21 @@
<default key="_view">cart</default>
</route>
<route id="order.delivery" path="/order/delivery" methods="post">
<default key="_controller">Thelia\Controller\Front\OrderController::deliver</default>
<default key="_view">order_delivery</default>
</route>
<route id="order.delivery.process" path="/order/delivery">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">order_delivery</default>
</route>
<route id="order.invoice" path="/order/invoice">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">order_invoice</default>
</route>
<!-- end cart routes -->
<!-- order management process -->

View File

@@ -57,4 +57,11 @@ class BaseFrontController extends BaseController
$this->redirectToRoute("customer.login.view");
}
}
protected function checkCartNotEmpty()
{
if($this->getSession()->getCart()->countCartItems() == 0) {
$this->redirectToRoute("cart.view");
}
}
}

View File

@@ -0,0 +1,126 @@
<?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\Controller\Front;
use Propel\Runtime\Exception\PropelException;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Core\Event\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Form\OrderDelivery;
use Thelia\Log\Tlog;
use Thelia\Model\Base\AddressQuery;
use Thelia\Model\Order;
/**
* Class OrderController
* @package Thelia\Controller\Front
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class OrderController extends BaseFrontController
{
/**
* set billing address
* set delivery address
* set delivery module
*/
public function deliver()
{
$this->checkAuth();
$this->checkCartNotEmpty();
$message = false;
$orderDelivery = new OrderDelivery($this->getRequest());
$x = $this->getRequest();
$y = $_POST;
try {
$form = $this->validateForm($orderDelivery, "post");
$deliveryAddressId = $form->get("delivery-address")->getData();
$deliveryModuleId = $form->get("delivery-module")->getData();
/* check that the delivery address belong to the current customer */
$deliveryAddress = AddressQuery::create()->findPk($deliveryAddressId);
if($deliveryAddress->getCustomerId() !== $this->getSecurityContext()->getCustomerUser()->getId()) {
throw new \Exception("Address does not belong to the current customer");
}
/* check that the delivery module fetch the delivery address area */
$orderEvent = $this->getOrderEvent();
$orderEvent->setDeliveryAddress($deliveryAddressId);
$orderEvent->setDeliveryModule($deliveryModuleId);
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_ADDRESS, $orderEvent);
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent);
$this->redirectToRoute("order.invoice");
} catch (FormValidationException $e) {
$message = sprintf("Please check your input: %s", $e->getMessage());
} catch (PropelException $e) {
$this->getParserContext()->setGeneralError($e->getMessage());
} catch (\Exception $e) {
$message = sprintf("Sorry, an error occured: %s", $e->getMessage());
}
if ($message !== false) {
Tlog::getInstance()->error(sprintf("Error during order delivery process : %s. Exception was %s", $message, $e->getMessage()));
$orderDelivery->setErrorMessage($message);
$this->getParserContext()
->addForm($orderDelivery)
->setGeneralError($message)
;
}
}
protected function getOrderEvent()
{
$order = $this->getOrder($this->getRequest());
return new OrderEvent($order);
}
public function getOrder(Request $request)
{
$session = $request->getSession();
if (null !== $order = $session->getOrder()) {
return $order;
}
$order = new Order();
$session->setOrder($order);
return $order;
}
}

View File

@@ -0,0 +1,109 @@
<?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 Thelia\Model\Address;
use Thelia\Model\AddressQuery;
use Thelia\Model\Module;
use Thelia\Model\Order;
class OrderEvent extends ActionEvent
{
protected $order = null;
protected $billingAddress = null;
protected $deliveryAddress = null;
protected $deliveryModule = null;
/**
* @param Order $order
*/
public function __construct(Order $order)
{
$this->setOrder($order);
}
/**
* @param Order $order
*/
public function setOrder(Order $order)
{
$this->order = $order;
}
/**
* @param $address
*/
public function setBillingAddress($address)
{
$this->deliveryAddress = $address;
}
/**
* @param $address
*/
public function setDeliveryAddress($address)
{
$this->deliveryAddress = $address;
}
/**
* @param $module
*/
public function setDeliveryModule($module)
{
$this->deliveryModule = $module;
}
/**
* @return null|Order
*/
public function getOrder()
{
return $this->order;
}
/**
* @return array|mixed|Address
*/
public function getBillingAddress()
{
return $this->billingAddress;
}
/**
* @return array|mixed|Address
*/
public function getDeliveryAddress()
{
return $this->deliveryAddress;
}
/**
* @return array|mixed|Address
*/
public function getDeliveryModule()
{
return $this->deliveryModule;
}
}

View File

@@ -192,6 +192,13 @@ final class TheliaEvents
const CART_DELETEITEM = "action.deleteArticle";
/**
* Order linked event
*/
const ORDER_SET_BILLING_ADDRESS = "action.order.setBillingAddress";
const ORDER_SET_DELIVERY_ADDRESS = "action.order.setDeliveryAddress";
const ORDER_SET_DELIVERY_MODULE = "action.order.setDeliveryModule";
/**
* Sent on image processing
*/
@@ -203,7 +210,7 @@ final class TheliaEvents
const DOCUMENT_PROCESS = "action.processDocument";
/**
* Sent on cimage cache clear request
* Sent on image cache clear request
*/
const IMAGE_CLEAR_CACHE = "action.clearImageCache";

View File

@@ -29,6 +29,7 @@ use Thelia\Exception\InvalidCartException;
use Thelia\Model\CartQuery;
use Thelia\Model\Cart;
use Thelia\Model\Currency;
use Thelia\Model\Order;
use Thelia\Tools\URL;
use Thelia\Model\Lang;
@@ -43,6 +44,8 @@ use Thelia\Model\Lang;
class Session extends BaseSession
{
/**
* @param bool $forceDefault
*
* @return \Thelia\Model\Lang|null
*/
public function getLang($forceDefault = true)
@@ -205,22 +208,19 @@ class Session extends BaseSession
return $this;
}
/**
* assign delivery id in session
*
* @param $delivery_id
* @return $this
*/
public function setDelivery($delivery_id)
// -- Order ------------------------------------------------------------------
public function setOrder(Order $order)
{
$this->set("thelia.delivery_id", $delivery_id);
$this->set("thelia.order", $order);
return $this;
}
public function getDelivery()
public function getOrder()
{
return $this->get("thelia.delivery_id");
return $this->get("thelia.order");
}

View File

@@ -13,6 +13,7 @@ use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Model\CountryQuery;
class Cart extends BaseLoop
{
@@ -82,7 +83,7 @@ class Cart extends BaseLoop
foreach ($cartItems as $cartItem) {
$product = $cartItem->getProduct();
//$product->setLocale($this->request->getSession()->getLocale());
$productSaleElement = $cartItem->getProductSaleElements();
$loopResultRow = new LoopResultRow($result, $cartItem, $this->versionable, $this->timestampable, $this->countable);
@@ -92,6 +93,17 @@ class Cart extends BaseLoop
$loopResultRow->set("QUANTITY", $cartItem->getQuantity());
$loopResultRow->set("PRICE", $cartItem->getPrice());
$loopResultRow->set("PRODUCT_ID", $product->getId());
$loopResultRow->set("PRODUCT_URL", $product->getUrl($this->request->getSession()->getLang()->getLocale()))
->set("STOCK", $productSaleElement->getQuantity())
->set("PRICE", $cartItem->getPrice())
->set("PROMO_PRICE", $cartItem->getPromoPrice())
->set("TAXED_PRICE", $cartItem->getTaxedPrice(
CountryQuery::create()->findOneById(64) // @TODO : make it magic
))
->set("PROMO_TAXED_PRICE", $cartItem->getTaxedPromoPrice(
CountryQuery::create()->findOneById(64) // @TODO : make it magic
))
->set("IS_PROMO", $cartItem->getPromo() === 1 ? 1 : 0);
$result->addRow($loopResultRow);
}

View File

@@ -22,9 +22,12 @@
/*************************************************************************************/
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\CountryQuery;
use Thelia\Module\BaseModule;
/**
* Class Delivery
@@ -50,6 +53,19 @@ class Delivery extends BaseSpecificModule
$search = parent::exec($pagination);
/* manage translations */
$locale = $this->configureI18nProcessing($search);
$search->filterByType(BaseModule::DELIVERY_MODULE_TYPE, Criteria::EQUAL);
$countryId = $this->getCountry();
if(null !== $countryId) {
$country = CountryQuery::create()->findPk($countryId);
if(null === $country) {
throw new \InvalidArgumentException('Cannot found country id: `' . $countryId . '` in delivery loop');
}
} else {
$country = CountryQuery::create()->findOneByByDefault(1);
}
/* perform search */
$deliveryModules = $this->search($search, $pagination);
@@ -73,7 +89,7 @@ class Delivery extends BaseSpecificModule
->set('CHAPO', $deliveryModule->getVirtualColumn('i18n_CHAPO'))
->set('DESCRIPTION', $deliveryModule->getVirtualColumn('i18n_DESCRIPTION'))
->set('POSTSCRIPTUM', $deliveryModule->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set('PRICE', $moduleInstance->calculate($this->getCountry()))
->set('PRICE', $moduleInstance->calculate($country))
;
$loopResult->addRow($loopResultRow);

View File

@@ -115,7 +115,7 @@ class ProductSaleElements extends BaseLoop
$currencyId = $this->getCurrency();
if (null !== $currencyId) {
$currency = CurrencyQuery::create()->findOneById($currencyId);
$currency = CurrencyQuery::create()->findPk($currencyId);
if (null === $currency) {
throw new \InvalidArgumentException('Cannot found currency id: `' . $currency . '` in product_sale_elements loop');
}

View File

@@ -31,6 +31,7 @@ use Thelia\Core\Template\ParserContext;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
use Thelia\Model\CategoryQuery;
use Thelia\Model\ContentQuery;
use Thelia\Model\CountryQuery;
use Thelia\Model\CurrencyQuery;
use Thelia\Model\FolderQuery;
use Thelia\Model\Product;
@@ -154,20 +155,42 @@ class DataAccessFunctions extends AbstractSmartyPlugin
}
}
public function countryDataAccess($params, $smarty)
{
$defaultCountry = CountryQuery::create()->findOneByByDefault(1);
switch($params["attr"]) {
case "default":
return $defaultCountry->getId();
}
}
public function cartDataAccess($params, $smarty)
{
$cart = $this->getCart($this->request);
$result = "";
switch($params["attr"]) {
case "count_item":
$result = $cart->getCartItems()->count();
break;
case "total_price":
$result = $cart->getTotalAmount();
break;
case "total_taxed_price":
$result = $cart->getTaxedAmount(
CountryQuery::create()->findOneById(64) // @TODO : make it magic
);
break;
}
return $result;
}
public function orderDataAccess($params, &$smarty)
{
return $this->dataAccess("Order", $params, $this->request->getSession()->getOrder());
}
/**
* Lang global data
*
@@ -279,8 +302,10 @@ class DataAccessFunctions extends AbstractSmartyPlugin
new SmartyPluginDescriptor('function', 'content', $this, 'contentDataAccess'),
new SmartyPluginDescriptor('function', 'folder', $this, 'folderDataAccess'),
new SmartyPluginDescriptor('function', 'currency', $this, 'currencyDataAccess'),
new SmartyPluginDescriptor('function', 'country', $this, 'countryDataAccess'),
new SmartyPluginDescriptor('function', 'lang', $this, 'langDataAccess'),
new SmartyPluginDescriptor('function', 'cart', $this, 'cartDataAccess'),
new SmartyPluginDescriptor('function', 'order', $this, 'orderDataAccess'),
);
}
}

View File

@@ -0,0 +1,94 @@
<?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 Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Model\AddressQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ModuleQuery;
use Thelia\Module\BaseModule;
/**
* Class OrderDelivery
* @package Thelia\Form
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class OrderDelivery extends BaseForm
{
protected function buildForm()
{
$this->formBuilder
->add("delivery-address", "integer", array(
"required" => true,
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Callback(array(
"methods" => array(
array($this, "verifyDeliveryAddress")
)
))
)
))
->add("delivery-module", "integer", array(
"required" => true,
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Callback(array(
"methods" => array(
array($this, "verifyDeliveryModule")
)
))
)
));
}
public function verifyDeliveryAddress($value, ExecutionContextInterface $context)
{
$address = AddressQuery::create()
->findPk($value);
if(null === $address) {
$context->addViolation("Address ID not found");
}
}
public function verifyDeliveryModule($value, ExecutionContextInterface $context)
{
$module = ModuleQuery::create()
->filterByType(BaseModule::DELIVERY_MODULE_TYPE)
->filterByActivate(1)
->filterById($value)
->find();
if(null === $module) {
$context->addViolation("Delivery module ID not found");
}
}
public function getName()
{
return "thelia_order_delivery";
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\AreaDeliveryModule as BaseAreaDeliveryModule;
class AreaDeliveryModule extends BaseAreaDeliveryModule
{
}

View File

@@ -2,11 +2,11 @@
namespace Thelia\Model;
use Thelia\Model\Base\DelivzoneQuery as BaseDelivzoneQuery;
use Thelia\Model\Base\AreaDeliveryModuleQuery as BaseAreaDeliveryModuleQuery;
/**
* Skeleton subclass for performing query and update operations on the 'delivzone' table.
* Skeleton subclass for performing query and update operations on the 'area_delivery_module' table.
*
*
*
@@ -15,6 +15,7 @@ use Thelia\Model\Base\DelivzoneQuery as BaseDelivzoneQuery;
* long as it does not already exist in the output directory.
*
*/
class DelivzoneQuery extends BaseDelivzoneQuery {
class AreaDeliveryModuleQuery extends BaseAreaDeliveryModuleQuery
{
} // DelivzoneQuery
} // AreaDeliveryModuleQuery

View File

@@ -18,11 +18,11 @@ use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Area as ChildArea;
use Thelia\Model\AreaDeliveryModule as ChildAreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery as ChildAreaDeliveryModuleQuery;
use Thelia\Model\AreaQuery as ChildAreaQuery;
use Thelia\Model\Country as ChildCountry;
use Thelia\Model\CountryQuery as ChildCountryQuery;
use Thelia\Model\Delivzone as ChildDelivzone;
use Thelia\Model\DelivzoneQuery as ChildDelivzoneQuery;
use Thelia\Model\Map\AreaTableMap;
abstract class Area implements ActiveRecordInterface
@@ -72,10 +72,10 @@ abstract class Area implements ActiveRecordInterface
protected $name;
/**
* The value for the unit field.
* The value for the postage field.
* @var double
*/
protected $unit;
protected $postage;
/**
* The value for the created_at field.
@@ -96,10 +96,10 @@ abstract class Area implements ActiveRecordInterface
protected $collCountriesPartial;
/**
* @var ObjectCollection|ChildDelivzone[] Collection to store aggregation of ChildDelivzone objects.
* @var ObjectCollection|ChildAreaDeliveryModule[] Collection to store aggregation of ChildAreaDeliveryModule objects.
*/
protected $collDelivzones;
protected $collDelivzonesPartial;
protected $collAreaDeliveryModules;
protected $collAreaDeliveryModulesPartial;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -119,7 +119,7 @@ abstract class Area implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $delivzonesScheduledForDeletion = null;
protected $areaDeliveryModulesScheduledForDeletion = null;
/**
* Initializes internal state of Thelia\Model\Base\Area object.
@@ -398,14 +398,14 @@ abstract class Area implements ActiveRecordInterface
}
/**
* Get the [unit] column value.
* Get the [postage] column value.
*
* @return double
*/
public function getUnit()
public function getPostage()
{
return $this->unit;
return $this->postage;
}
/**
@@ -491,25 +491,25 @@ abstract class Area implements ActiveRecordInterface
} // setName()
/**
* Set the value of [unit] column.
* Set the value of [postage] column.
*
* @param double $v new value
* @return \Thelia\Model\Area The current object (for fluent API support)
*/
public function setUnit($v)
public function setPostage($v)
{
if ($v !== null) {
$v = (double) $v;
}
if ($this->unit !== $v) {
$this->unit = $v;
$this->modifiedColumns[] = AreaTableMap::UNIT;
if ($this->postage !== $v) {
$this->postage = $v;
$this->modifiedColumns[] = AreaTableMap::POSTAGE;
}
return $this;
} // setUnit()
} // setPostage()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
@@ -596,8 +596,8 @@ abstract class Area implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AreaTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
$this->name = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AreaTableMap::translateFieldName('Unit', TableMap::TYPE_PHPNAME, $indexType)];
$this->unit = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AreaTableMap::translateFieldName('Postage', TableMap::TYPE_PHPNAME, $indexType)];
$this->postage = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AreaTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
@@ -681,7 +681,7 @@ abstract class Area implements ActiveRecordInterface
$this->collCountries = null;
$this->collDelivzones = null;
$this->collAreaDeliveryModules = null;
} // if (deep)
}
@@ -834,18 +834,17 @@ abstract class Area implements ActiveRecordInterface
}
}
if ($this->delivzonesScheduledForDeletion !== null) {
if (!$this->delivzonesScheduledForDeletion->isEmpty()) {
foreach ($this->delivzonesScheduledForDeletion as $delivzone) {
// need to save related object because we set the relation to null
$delivzone->save($con);
}
$this->delivzonesScheduledForDeletion = null;
if ($this->areaDeliveryModulesScheduledForDeletion !== null) {
if (!$this->areaDeliveryModulesScheduledForDeletion->isEmpty()) {
\Thelia\Model\AreaDeliveryModuleQuery::create()
->filterByPrimaryKeys($this->areaDeliveryModulesScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->areaDeliveryModulesScheduledForDeletion = null;
}
}
if ($this->collDelivzones !== null) {
foreach ($this->collDelivzones as $referrerFK) {
if ($this->collAreaDeliveryModules !== null) {
foreach ($this->collAreaDeliveryModules as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -884,8 +883,8 @@ abstract class Area implements ActiveRecordInterface
if ($this->isColumnModified(AreaTableMap::NAME)) {
$modifiedColumns[':p' . $index++] = 'NAME';
}
if ($this->isColumnModified(AreaTableMap::UNIT)) {
$modifiedColumns[':p' . $index++] = 'UNIT';
if ($this->isColumnModified(AreaTableMap::POSTAGE)) {
$modifiedColumns[':p' . $index++] = 'POSTAGE';
}
if ($this->isColumnModified(AreaTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
@@ -910,8 +909,8 @@ abstract class Area implements ActiveRecordInterface
case 'NAME':
$stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
break;
case 'UNIT':
$stmt->bindValue($identifier, $this->unit, PDO::PARAM_STR);
case 'POSTAGE':
$stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -988,7 +987,7 @@ abstract class Area implements ActiveRecordInterface
return $this->getName();
break;
case 2:
return $this->getUnit();
return $this->getPostage();
break;
case 3:
return $this->getCreatedAt();
@@ -1027,7 +1026,7 @@ abstract class Area implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getName(),
$keys[2] => $this->getUnit(),
$keys[2] => $this->getPostage(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
);
@@ -1041,8 +1040,8 @@ abstract class Area implements ActiveRecordInterface
if (null !== $this->collCountries) {
$result['Countries'] = $this->collCountries->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collDelivzones) {
$result['Delivzones'] = $this->collDelivzones->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->collAreaDeliveryModules) {
$result['AreaDeliveryModules'] = $this->collAreaDeliveryModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
@@ -1085,7 +1084,7 @@ abstract class Area implements ActiveRecordInterface
$this->setName($value);
break;
case 2:
$this->setUnit($value);
$this->setPostage($value);
break;
case 3:
$this->setCreatedAt($value);
@@ -1119,7 +1118,7 @@ abstract class Area implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setUnit($arr[$keys[2]]);
if (array_key_exists($keys[2], $arr)) $this->setPostage($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
}
@@ -1135,7 +1134,7 @@ abstract class Area implements ActiveRecordInterface
if ($this->isColumnModified(AreaTableMap::ID)) $criteria->add(AreaTableMap::ID, $this->id);
if ($this->isColumnModified(AreaTableMap::NAME)) $criteria->add(AreaTableMap::NAME, $this->name);
if ($this->isColumnModified(AreaTableMap::UNIT)) $criteria->add(AreaTableMap::UNIT, $this->unit);
if ($this->isColumnModified(AreaTableMap::POSTAGE)) $criteria->add(AreaTableMap::POSTAGE, $this->postage);
if ($this->isColumnModified(AreaTableMap::CREATED_AT)) $criteria->add(AreaTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AreaTableMap::UPDATED_AT)) $criteria->add(AreaTableMap::UPDATED_AT, $this->updated_at);
@@ -1202,7 +1201,7 @@ abstract class Area implements ActiveRecordInterface
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setName($this->getName());
$copyObj->setUnit($this->getUnit());
$copyObj->setPostage($this->getPostage());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1217,9 +1216,9 @@ abstract class Area implements ActiveRecordInterface
}
}
foreach ($this->getDelivzones() as $relObj) {
foreach ($this->getAreaDeliveryModules() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addDelivzone($relObj->copy($deepCopy));
$copyObj->addAreaDeliveryModule($relObj->copy($deepCopy));
}
}
@@ -1267,8 +1266,8 @@ abstract class Area implements ActiveRecordInterface
if ('Country' == $relationName) {
return $this->initCountries();
}
if ('Delivzone' == $relationName) {
return $this->initDelivzones();
if ('AreaDeliveryModule' == $relationName) {
return $this->initAreaDeliveryModules();
}
}
@@ -1491,31 +1490,31 @@ abstract class Area implements ActiveRecordInterface
}
/**
* Clears out the collDelivzones collection
* Clears out the collAreaDeliveryModules collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addDelivzones()
* @see addAreaDeliveryModules()
*/
public function clearDelivzones()
public function clearAreaDeliveryModules()
{
$this->collDelivzones = null; // important to set this to NULL since that means it is uninitialized
$this->collAreaDeliveryModules = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collDelivzones collection loaded partially.
* Reset is the collAreaDeliveryModules collection loaded partially.
*/
public function resetPartialDelivzones($v = true)
public function resetPartialAreaDeliveryModules($v = true)
{
$this->collDelivzonesPartial = $v;
$this->collAreaDeliveryModulesPartial = $v;
}
/**
* Initializes the collDelivzones collection.
* Initializes the collAreaDeliveryModules collection.
*
* By default this just sets the collDelivzones collection to an empty array (like clearcollDelivzones());
* By default this just sets the collAreaDeliveryModules collection to an empty array (like clearcollAreaDeliveryModules());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
@@ -1524,17 +1523,17 @@ abstract class Area implements ActiveRecordInterface
*
* @return void
*/
public function initDelivzones($overrideExisting = true)
public function initAreaDeliveryModules($overrideExisting = true)
{
if (null !== $this->collDelivzones && !$overrideExisting) {
if (null !== $this->collAreaDeliveryModules && !$overrideExisting) {
return;
}
$this->collDelivzones = new ObjectCollection();
$this->collDelivzones->setModel('\Thelia\Model\Delivzone');
$this->collAreaDeliveryModules = new ObjectCollection();
$this->collAreaDeliveryModules->setModel('\Thelia\Model\AreaDeliveryModule');
}
/**
* Gets an array of ChildDelivzone objects which contain a foreign key that references this object.
* Gets an array of ChildAreaDeliveryModule objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
@@ -1544,109 +1543,109 @@ abstract class Area implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @return Collection|ChildDelivzone[] List of ChildDelivzone objects
* @return Collection|ChildAreaDeliveryModule[] List of ChildAreaDeliveryModule objects
* @throws PropelException
*/
public function getDelivzones($criteria = null, ConnectionInterface $con = null)
public function getAreaDeliveryModules($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collDelivzonesPartial && !$this->isNew();
if (null === $this->collDelivzones || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collDelivzones) {
$partial = $this->collAreaDeliveryModulesPartial && !$this->isNew();
if (null === $this->collAreaDeliveryModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collAreaDeliveryModules) {
// return empty collection
$this->initDelivzones();
$this->initAreaDeliveryModules();
} else {
$collDelivzones = ChildDelivzoneQuery::create(null, $criteria)
$collAreaDeliveryModules = ChildAreaDeliveryModuleQuery::create(null, $criteria)
->filterByArea($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collDelivzonesPartial && count($collDelivzones)) {
$this->initDelivzones(false);
if (false !== $this->collAreaDeliveryModulesPartial && count($collAreaDeliveryModules)) {
$this->initAreaDeliveryModules(false);
foreach ($collDelivzones as $obj) {
if (false == $this->collDelivzones->contains($obj)) {
$this->collDelivzones->append($obj);
foreach ($collAreaDeliveryModules as $obj) {
if (false == $this->collAreaDeliveryModules->contains($obj)) {
$this->collAreaDeliveryModules->append($obj);
}
}
$this->collDelivzonesPartial = true;
$this->collAreaDeliveryModulesPartial = true;
}
$collDelivzones->getInternalIterator()->rewind();
$collAreaDeliveryModules->getInternalIterator()->rewind();
return $collDelivzones;
return $collAreaDeliveryModules;
}
if ($partial && $this->collDelivzones) {
foreach ($this->collDelivzones as $obj) {
if ($partial && $this->collAreaDeliveryModules) {
foreach ($this->collAreaDeliveryModules as $obj) {
if ($obj->isNew()) {
$collDelivzones[] = $obj;
$collAreaDeliveryModules[] = $obj;
}
}
}
$this->collDelivzones = $collDelivzones;
$this->collDelivzonesPartial = false;
$this->collAreaDeliveryModules = $collAreaDeliveryModules;
$this->collAreaDeliveryModulesPartial = false;
}
}
return $this->collDelivzones;
return $this->collAreaDeliveryModules;
}
/**
* Sets a collection of Delivzone objects related by a one-to-many relationship
* Sets a collection of AreaDeliveryModule objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param Collection $delivzones A Propel collection.
* @param Collection $areaDeliveryModules A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildArea The current object (for fluent API support)
*/
public function setDelivzones(Collection $delivzones, ConnectionInterface $con = null)
public function setAreaDeliveryModules(Collection $areaDeliveryModules, ConnectionInterface $con = null)
{
$delivzonesToDelete = $this->getDelivzones(new Criteria(), $con)->diff($delivzones);
$areaDeliveryModulesToDelete = $this->getAreaDeliveryModules(new Criteria(), $con)->diff($areaDeliveryModules);
$this->delivzonesScheduledForDeletion = $delivzonesToDelete;
$this->areaDeliveryModulesScheduledForDeletion = $areaDeliveryModulesToDelete;
foreach ($delivzonesToDelete as $delivzoneRemoved) {
$delivzoneRemoved->setArea(null);
foreach ($areaDeliveryModulesToDelete as $areaDeliveryModuleRemoved) {
$areaDeliveryModuleRemoved->setArea(null);
}
$this->collDelivzones = null;
foreach ($delivzones as $delivzone) {
$this->addDelivzone($delivzone);
$this->collAreaDeliveryModules = null;
foreach ($areaDeliveryModules as $areaDeliveryModule) {
$this->addAreaDeliveryModule($areaDeliveryModule);
}
$this->collDelivzones = $delivzones;
$this->collDelivzonesPartial = false;
$this->collAreaDeliveryModules = $areaDeliveryModules;
$this->collAreaDeliveryModulesPartial = false;
return $this;
}
/**
* Returns the number of related Delivzone objects.
* Returns the number of related AreaDeliveryModule objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related Delivzone objects.
* @return int Count of related AreaDeliveryModule objects.
* @throws PropelException
*/
public function countDelivzones(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countAreaDeliveryModules(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collDelivzonesPartial && !$this->isNew();
if (null === $this->collDelivzones || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collDelivzones) {
$partial = $this->collAreaDeliveryModulesPartial && !$this->isNew();
if (null === $this->collAreaDeliveryModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collAreaDeliveryModules) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getDelivzones());
return count($this->getAreaDeliveryModules());
}
$query = ChildDelivzoneQuery::create(null, $criteria);
$query = ChildAreaDeliveryModuleQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1656,58 +1655,83 @@ abstract class Area implements ActiveRecordInterface
->count($con);
}
return count($this->collDelivzones);
return count($this->collAreaDeliveryModules);
}
/**
* Method called to associate a ChildDelivzone object to this object
* through the ChildDelivzone foreign key attribute.
* Method called to associate a ChildAreaDeliveryModule object to this object
* through the ChildAreaDeliveryModule foreign key attribute.
*
* @param ChildDelivzone $l ChildDelivzone
* @param ChildAreaDeliveryModule $l ChildAreaDeliveryModule
* @return \Thelia\Model\Area The current object (for fluent API support)
*/
public function addDelivzone(ChildDelivzone $l)
public function addAreaDeliveryModule(ChildAreaDeliveryModule $l)
{
if ($this->collDelivzones === null) {
$this->initDelivzones();
$this->collDelivzonesPartial = true;
if ($this->collAreaDeliveryModules === null) {
$this->initAreaDeliveryModules();
$this->collAreaDeliveryModulesPartial = true;
}
if (!in_array($l, $this->collDelivzones->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddDelivzone($l);
if (!in_array($l, $this->collAreaDeliveryModules->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddAreaDeliveryModule($l);
}
return $this;
}
/**
* @param Delivzone $delivzone The delivzone object to add.
* @param AreaDeliveryModule $areaDeliveryModule The areaDeliveryModule object to add.
*/
protected function doAddDelivzone($delivzone)
protected function doAddAreaDeliveryModule($areaDeliveryModule)
{
$this->collDelivzones[]= $delivzone;
$delivzone->setArea($this);
$this->collAreaDeliveryModules[]= $areaDeliveryModule;
$areaDeliveryModule->setArea($this);
}
/**
* @param Delivzone $delivzone The delivzone object to remove.
* @param AreaDeliveryModule $areaDeliveryModule The areaDeliveryModule object to remove.
* @return ChildArea The current object (for fluent API support)
*/
public function removeDelivzone($delivzone)
public function removeAreaDeliveryModule($areaDeliveryModule)
{
if ($this->getDelivzones()->contains($delivzone)) {
$this->collDelivzones->remove($this->collDelivzones->search($delivzone));
if (null === $this->delivzonesScheduledForDeletion) {
$this->delivzonesScheduledForDeletion = clone $this->collDelivzones;
$this->delivzonesScheduledForDeletion->clear();
if ($this->getAreaDeliveryModules()->contains($areaDeliveryModule)) {
$this->collAreaDeliveryModules->remove($this->collAreaDeliveryModules->search($areaDeliveryModule));
if (null === $this->areaDeliveryModulesScheduledForDeletion) {
$this->areaDeliveryModulesScheduledForDeletion = clone $this->collAreaDeliveryModules;
$this->areaDeliveryModulesScheduledForDeletion->clear();
}
$this->delivzonesScheduledForDeletion[]= $delivzone;
$delivzone->setArea(null);
$this->areaDeliveryModulesScheduledForDeletion[]= clone $areaDeliveryModule;
$areaDeliveryModule->setArea(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Area is new, it will return
* an empty collection; or if this Area has previously
* been saved, it will retrieve related AreaDeliveryModules from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Area.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildAreaDeliveryModule[] List of ChildAreaDeliveryModule objects
*/
public function getAreaDeliveryModulesJoinModule($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildAreaDeliveryModuleQuery::create(null, $criteria);
$query->joinWith('Module', $joinBehavior);
return $this->getAreaDeliveryModules($query, $con);
}
/**
* Clears the current object and sets all attributes to their default values
*/
@@ -1715,7 +1739,7 @@ abstract class Area implements ActiveRecordInterface
{
$this->id = null;
$this->name = null;
$this->unit = null;
$this->postage = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1742,8 +1766,8 @@ abstract class Area implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collDelivzones) {
foreach ($this->collDelivzones as $o) {
if ($this->collAreaDeliveryModules) {
foreach ($this->collAreaDeliveryModules as $o) {
$o->clearAllReferences($deep);
}
}
@@ -1753,10 +1777,10 @@ abstract class Area implements ActiveRecordInterface
$this->collCountries->clearIterator();
}
$this->collCountries = null;
if ($this->collDelivzones instanceof Collection) {
$this->collDelivzones->clearIterator();
if ($this->collAreaDeliveryModules instanceof Collection) {
$this->collAreaDeliveryModules->clearIterator();
}
$this->collDelivzones = null;
$this->collAreaDeliveryModules = null;
}
/**

View File

@@ -17,17 +17,19 @@ use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Area as ChildArea;
use Thelia\Model\AreaDeliveryModule as ChildAreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery as ChildAreaDeliveryModuleQuery;
use Thelia\Model\AreaQuery as ChildAreaQuery;
use Thelia\Model\Delivzone as ChildDelivzone;
use Thelia\Model\DelivzoneQuery as ChildDelivzoneQuery;
use Thelia\Model\Map\DelivzoneTableMap;
use Thelia\Model\Module as ChildModule;
use Thelia\Model\ModuleQuery as ChildModuleQuery;
use Thelia\Model\Map\AreaDeliveryModuleTableMap;
abstract class Delivzone implements ActiveRecordInterface
abstract class AreaDeliveryModule implements ActiveRecordInterface
{
/**
* TableMap class name
*/
const TABLE_MAP = '\\Thelia\\Model\\Map\\DelivzoneTableMap';
const TABLE_MAP = '\\Thelia\\Model\\Map\\AreaDeliveryModuleTableMap';
/**
@@ -69,10 +71,10 @@ abstract class Delivzone implements ActiveRecordInterface
protected $area_id;
/**
* The value for the delivery field.
* @var string
* The value for the delivery_module_id field.
* @var int
*/
protected $delivery;
protected $delivery_module_id;
/**
* The value for the created_at field.
@@ -91,6 +93,11 @@ abstract class Delivzone implements ActiveRecordInterface
*/
protected $aArea;
/**
* @var Module
*/
protected $aModule;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -100,7 +107,7 @@ abstract class Delivzone implements ActiveRecordInterface
protected $alreadyInSave = false;
/**
* Initializes internal state of Thelia\Model\Base\Delivzone object.
* Initializes internal state of Thelia\Model\Base\AreaDeliveryModule object.
*/
public function __construct()
{
@@ -195,9 +202,9 @@ abstract class Delivzone implements ActiveRecordInterface
}
/**
* Compares this with another <code>Delivzone</code> instance. If
* <code>obj</code> is an instance of <code>Delivzone</code>, delegates to
* <code>equals(Delivzone)</code>. Otherwise, returns <code>false</code>.
* Compares this with another <code>AreaDeliveryModule</code> instance. If
* <code>obj</code> is an instance of <code>AreaDeliveryModule</code>, delegates to
* <code>equals(AreaDeliveryModule)</code>. Otherwise, returns <code>false</code>.
*
* @param obj The object to compare to.
* @return Whether equal to the object specified.
@@ -278,7 +285,7 @@ abstract class Delivzone implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
* @return Delivzone The current object, for fluid interface
* @return AreaDeliveryModule The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -310,7 +317,7 @@ abstract class Delivzone implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
* @return Delivzone The current object, for fluid interface
* @return AreaDeliveryModule The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -376,14 +383,14 @@ abstract class Delivzone implements ActiveRecordInterface
}
/**
* Get the [delivery] column value.
* Get the [delivery_module_id] column value.
*
* @return string
* @return int
*/
public function getDelivery()
public function getDeliveryModuleId()
{
return $this->delivery;
return $this->delivery_module_id;
}
/**
@@ -430,7 +437,7 @@ abstract class Delivzone implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
*/
public function setId($v)
{
@@ -440,7 +447,7 @@ abstract class Delivzone implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = DelivzoneTableMap::ID;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::ID;
}
@@ -451,7 +458,7 @@ abstract class Delivzone implements ActiveRecordInterface
* Set the value of [area_id] column.
*
* @param int $v new value
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
*/
public function setAreaId($v)
{
@@ -461,7 +468,7 @@ abstract class Delivzone implements ActiveRecordInterface
if ($this->area_id !== $v) {
$this->area_id = $v;
$this->modifiedColumns[] = DelivzoneTableMap::AREA_ID;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::AREA_ID;
}
if ($this->aArea !== null && $this->aArea->getId() !== $v) {
@@ -473,32 +480,36 @@ abstract class Delivzone implements ActiveRecordInterface
} // setAreaId()
/**
* Set the value of [delivery] column.
* Set the value of [delivery_module_id] column.
*
* @param string $v new value
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @param int $v new value
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
*/
public function setDelivery($v)
public function setDeliveryModuleId($v)
{
if ($v !== null) {
$v = (string) $v;
$v = (int) $v;
}
if ($this->delivery !== $v) {
$this->delivery = $v;
$this->modifiedColumns[] = DelivzoneTableMap::DELIVERY;
if ($this->delivery_module_id !== $v) {
$this->delivery_module_id = $v;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID;
}
if ($this->aModule !== null && $this->aModule->getId() !== $v) {
$this->aModule = null;
}
return $this;
} // setDelivery()
} // setDeliveryModuleId()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -506,7 +517,7 @@ abstract class Delivzone implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
$this->modifiedColumns[] = DelivzoneTableMap::CREATED_AT;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::CREATED_AT;
}
} // if either are not null
@@ -519,7 +530,7 @@ abstract class Delivzone implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -527,7 +538,7 @@ abstract class Delivzone implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
$this->modifiedColumns[] = DelivzoneTableMap::UPDATED_AT;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::UPDATED_AT;
}
} // if either are not null
@@ -572,22 +583,22 @@ abstract class Delivzone implements ActiveRecordInterface
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : DelivzoneTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AreaDeliveryModuleTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : DelivzoneTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AreaDeliveryModuleTableMap::translateFieldName('AreaId', TableMap::TYPE_PHPNAME, $indexType)];
$this->area_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : DelivzoneTableMap::translateFieldName('Delivery', TableMap::TYPE_PHPNAME, $indexType)];
$this->delivery = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AreaDeliveryModuleTableMap::translateFieldName('DeliveryModuleId', TableMap::TYPE_PHPNAME, $indexType)];
$this->delivery_module_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : DelivzoneTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AreaDeliveryModuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : DelivzoneTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AreaDeliveryModuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -600,10 +611,10 @@ abstract class Delivzone implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 5; // 5 = DelivzoneTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 5; // 5 = AreaDeliveryModuleTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Delivzone object", 0, $e);
throw new PropelException("Error populating \Thelia\Model\AreaDeliveryModule object", 0, $e);
}
}
@@ -625,6 +636,9 @@ abstract class Delivzone implements ActiveRecordInterface
if ($this->aArea !== null && $this->area_id !== $this->aArea->getId()) {
$this->aArea = null;
}
if ($this->aModule !== null && $this->delivery_module_id !== $this->aModule->getId()) {
$this->aModule = null;
}
} // ensureConsistency
/**
@@ -648,13 +662,13 @@ abstract class Delivzone implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
$dataFetcher = ChildDelivzoneQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$dataFetcher = ChildAreaDeliveryModuleQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -665,6 +679,7 @@ abstract class Delivzone implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aArea = null;
$this->aModule = null;
} // if (deep)
}
@@ -674,8 +689,8 @@ abstract class Delivzone implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
* @see Delivzone::setDeleted()
* @see Delivzone::isDeleted()
* @see AreaDeliveryModule::setDeleted()
* @see AreaDeliveryModule::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -684,12 +699,12 @@ abstract class Delivzone implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$deleteQuery = ChildDelivzoneQuery::create()
$deleteQuery = ChildAreaDeliveryModuleQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -726,7 +741,7 @@ abstract class Delivzone implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -736,16 +751,16 @@ abstract class Delivzone implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
if (!$this->isColumnModified(DelivzoneTableMap::CREATED_AT)) {
if (!$this->isColumnModified(AreaDeliveryModuleTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
if (!$this->isColumnModified(DelivzoneTableMap::UPDATED_AT)) {
if (!$this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
if ($this->isModified() && !$this->isColumnModified(DelivzoneTableMap::UPDATED_AT)) {
if ($this->isModified() && !$this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -757,7 +772,7 @@ abstract class Delivzone implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
DelivzoneTableMap::addInstanceToPool($this);
AreaDeliveryModuleTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -799,6 +814,13 @@ abstract class Delivzone implements ActiveRecordInterface
$this->setArea($this->aArea);
}
if ($this->aModule !== null) {
if ($this->aModule->isModified() || $this->aModule->isNew()) {
$affectedRows += $this->aModule->save($con);
}
$this->setModule($this->aModule);
}
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
@@ -830,30 +852,30 @@ abstract class Delivzone implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = DelivzoneTableMap::ID;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . DelivzoneTableMap::ID . ')');
throw new PropelException('Cannot insert a value for auto-increment primary key (' . AreaDeliveryModuleTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(DelivzoneTableMap::ID)) {
if ($this->isColumnModified(AreaDeliveryModuleTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(DelivzoneTableMap::AREA_ID)) {
if ($this->isColumnModified(AreaDeliveryModuleTableMap::AREA_ID)) {
$modifiedColumns[':p' . $index++] = 'AREA_ID';
}
if ($this->isColumnModified(DelivzoneTableMap::DELIVERY)) {
$modifiedColumns[':p' . $index++] = 'DELIVERY';
if ($this->isColumnModified(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID)) {
$modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID';
}
if ($this->isColumnModified(DelivzoneTableMap::CREATED_AT)) {
if ($this->isColumnModified(AreaDeliveryModuleTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
if ($this->isColumnModified(DelivzoneTableMap::UPDATED_AT)) {
if ($this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
'INSERT INTO delivzone (%s) VALUES (%s)',
'INSERT INTO area_delivery_module (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -868,8 +890,8 @@ abstract class Delivzone implements ActiveRecordInterface
case 'AREA_ID':
$stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
break;
case 'DELIVERY':
$stmt->bindValue($identifier, $this->delivery, PDO::PARAM_STR);
case 'DELIVERY_MODULE_ID':
$stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
@@ -923,7 +945,7 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
$pos = DelivzoneTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = AreaDeliveryModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -946,7 +968,7 @@ abstract class Delivzone implements ActiveRecordInterface
return $this->getAreaId();
break;
case 2:
return $this->getDelivery();
return $this->getDeliveryModuleId();
break;
case 3:
return $this->getCreatedAt();
@@ -977,15 +999,15 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Delivzone'][$this->getPrimaryKey()])) {
if (isset($alreadyDumpedObjects['AreaDeliveryModule'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['Delivzone'][$this->getPrimaryKey()] = true;
$keys = DelivzoneTableMap::getFieldNames($keyType);
$alreadyDumpedObjects['AreaDeliveryModule'][$this->getPrimaryKey()] = true;
$keys = AreaDeliveryModuleTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getAreaId(),
$keys[2] => $this->getDelivery(),
$keys[2] => $this->getDeliveryModuleId(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
);
@@ -999,6 +1021,9 @@ abstract class Delivzone implements ActiveRecordInterface
if (null !== $this->aArea) {
$result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aModule) {
$result['Module'] = $this->aModule->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
@@ -1017,7 +1042,7 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
$pos = DelivzoneTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = AreaDeliveryModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1040,7 +1065,7 @@ abstract class Delivzone implements ActiveRecordInterface
$this->setAreaId($value);
break;
case 2:
$this->setDelivery($value);
$this->setDeliveryModuleId($value);
break;
case 3:
$this->setCreatedAt($value);
@@ -1070,11 +1095,11 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = DelivzoneTableMap::getFieldNames($keyType);
$keys = AreaDeliveryModuleTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setAreaId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDelivery($arr[$keys[2]]);
if (array_key_exists($keys[2], $arr)) $this->setDeliveryModuleId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
}
@@ -1086,13 +1111,13 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function buildCriteria()
{
$criteria = new Criteria(DelivzoneTableMap::DATABASE_NAME);
$criteria = new Criteria(AreaDeliveryModuleTableMap::DATABASE_NAME);
if ($this->isColumnModified(DelivzoneTableMap::ID)) $criteria->add(DelivzoneTableMap::ID, $this->id);
if ($this->isColumnModified(DelivzoneTableMap::AREA_ID)) $criteria->add(DelivzoneTableMap::AREA_ID, $this->area_id);
if ($this->isColumnModified(DelivzoneTableMap::DELIVERY)) $criteria->add(DelivzoneTableMap::DELIVERY, $this->delivery);
if ($this->isColumnModified(DelivzoneTableMap::CREATED_AT)) $criteria->add(DelivzoneTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(DelivzoneTableMap::UPDATED_AT)) $criteria->add(DelivzoneTableMap::UPDATED_AT, $this->updated_at);
if ($this->isColumnModified(AreaDeliveryModuleTableMap::ID)) $criteria->add(AreaDeliveryModuleTableMap::ID, $this->id);
if ($this->isColumnModified(AreaDeliveryModuleTableMap::AREA_ID)) $criteria->add(AreaDeliveryModuleTableMap::AREA_ID, $this->area_id);
if ($this->isColumnModified(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID)) $criteria->add(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $this->delivery_module_id);
if ($this->isColumnModified(AreaDeliveryModuleTableMap::CREATED_AT)) $criteria->add(AreaDeliveryModuleTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) $criteria->add(AreaDeliveryModuleTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1107,8 +1132,8 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(DelivzoneTableMap::DATABASE_NAME);
$criteria->add(DelivzoneTableMap::ID, $this->id);
$criteria = new Criteria(AreaDeliveryModuleTableMap::DATABASE_NAME);
$criteria->add(AreaDeliveryModuleTableMap::ID, $this->id);
return $criteria;
}
@@ -1149,7 +1174,7 @@ abstract class Delivzone implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of \Thelia\Model\Delivzone (or compatible) type.
* @param object $copyObj An object of \Thelia\Model\AreaDeliveryModule (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
* @throws PropelException
@@ -1157,7 +1182,7 @@ abstract class Delivzone implements ActiveRecordInterface
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setAreaId($this->getAreaId());
$copyObj->setDelivery($this->getDelivery());
$copyObj->setDeliveryModuleId($this->getDeliveryModuleId());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1175,7 +1200,7 @@ abstract class Delivzone implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return \Thelia\Model\Delivzone Clone of current object.
* @return \Thelia\Model\AreaDeliveryModule Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1192,7 +1217,7 @@ abstract class Delivzone implements ActiveRecordInterface
* Declares an association between this object and a ChildArea object.
*
* @param ChildArea $v
* @return \Thelia\Model\Delivzone The current object (for fluent API support)
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
* @throws PropelException
*/
public function setArea(ChildArea $v = null)
@@ -1208,7 +1233,7 @@ abstract class Delivzone implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildArea object, it will not be re-added.
if ($v !== null) {
$v->addDelivzone($this);
$v->addAreaDeliveryModule($this);
}
@@ -1232,13 +1257,64 @@ abstract class Delivzone implements ActiveRecordInterface
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aArea->addDelivzones($this);
$this->aArea->addAreaDeliveryModules($this);
*/
}
return $this->aArea;
}
/**
* Declares an association between this object and a ChildModule object.
*
* @param ChildModule $v
* @return \Thelia\Model\AreaDeliveryModule The current object (for fluent API support)
* @throws PropelException
*/
public function setModule(ChildModule $v = null)
{
if ($v === null) {
$this->setDeliveryModuleId(NULL);
} else {
$this->setDeliveryModuleId($v->getId());
}
$this->aModule = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildModule object, it will not be re-added.
if ($v !== null) {
$v->addAreaDeliveryModule($this);
}
return $this;
}
/**
* Get the associated ChildModule object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildModule The associated ChildModule object.
* @throws PropelException
*/
public function getModule(ConnectionInterface $con = null)
{
if ($this->aModule === null && ($this->delivery_module_id !== null)) {
$this->aModule = ChildModuleQuery::create()->findPk($this->delivery_module_id, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aModule->addAreaDeliveryModules($this);
*/
}
return $this->aModule;
}
/**
* Clears the current object and sets all attributes to their default values
*/
@@ -1246,7 +1322,7 @@ abstract class Delivzone implements ActiveRecordInterface
{
$this->id = null;
$this->area_id = null;
$this->delivery = null;
$this->delivery_module_id = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;
@@ -1271,6 +1347,7 @@ abstract class Delivzone implements ActiveRecordInterface
} // if ($deep)
$this->aArea = null;
$this->aModule = null;
}
/**
@@ -1280,7 +1357,7 @@ abstract class Delivzone implements ActiveRecordInterface
*/
public function __toString()
{
return (string) $this->exportTo(DelivzoneTableMap::DEFAULT_STRING_FORMAT);
return (string) $this->exportTo(AreaDeliveryModuleTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1288,11 +1365,11 @@ abstract class Delivzone implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
* @return ChildDelivzone The current object (for fluent API support)
* @return ChildAreaDeliveryModule The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
$this->modifiedColumns[] = DelivzoneTableMap::UPDATED_AT;
$this->modifiedColumns[] = AreaDeliveryModuleTableMap::UPDATED_AT;
return $this;
}

View File

@@ -12,80 +12,84 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Delivzone as ChildDelivzone;
use Thelia\Model\DelivzoneQuery as ChildDelivzoneQuery;
use Thelia\Model\Map\DelivzoneTableMap;
use Thelia\Model\AreaDeliveryModule as ChildAreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery as ChildAreaDeliveryModuleQuery;
use Thelia\Model\Map\AreaDeliveryModuleTableMap;
/**
* Base class that represents a query for the 'delivzone' table.
* Base class that represents a query for the 'area_delivery_module' table.
*
*
*
* @method ChildDelivzoneQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildDelivzoneQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildDelivzoneQuery orderByDelivery($order = Criteria::ASC) Order by the delivery column
* @method ChildDelivzoneQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildDelivzoneQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildAreaDeliveryModuleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAreaDeliveryModuleQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildAreaDeliveryModuleQuery orderByDeliveryModuleId($order = Criteria::ASC) Order by the delivery_module_id column
* @method ChildAreaDeliveryModuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAreaDeliveryModuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildDelivzoneQuery groupById() Group by the id column
* @method ChildDelivzoneQuery groupByAreaId() Group by the area_id column
* @method ChildDelivzoneQuery groupByDelivery() Group by the delivery column
* @method ChildDelivzoneQuery groupByCreatedAt() Group by the created_at column
* @method ChildDelivzoneQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildAreaDeliveryModuleQuery groupById() Group by the id column
* @method ChildAreaDeliveryModuleQuery groupByAreaId() Group by the area_id column
* @method ChildAreaDeliveryModuleQuery groupByDeliveryModuleId() Group by the delivery_module_id column
* @method ChildAreaDeliveryModuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildAreaDeliveryModuleQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildDelivzoneQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildDelivzoneQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildDelivzoneQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* @method ChildAreaDeliveryModuleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAreaDeliveryModuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAreaDeliveryModuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildDelivzoneQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildDelivzoneQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildDelivzoneQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
* @method ChildAreaDeliveryModuleQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildAreaDeliveryModuleQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildAreaDeliveryModuleQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildDelivzone findOne(ConnectionInterface $con = null) Return the first ChildDelivzone matching the query
* @method ChildDelivzone findOneOrCreate(ConnectionInterface $con = null) Return the first ChildDelivzone matching the query, or a new ChildDelivzone object populated from the query conditions when no match is found
* @method ChildAreaDeliveryModuleQuery leftJoinModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the Module relation
* @method ChildAreaDeliveryModuleQuery rightJoinModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Module relation
* @method ChildAreaDeliveryModuleQuery innerJoinModule($relationAlias = null) Adds a INNER JOIN clause to the query using the Module relation
*
* @method ChildDelivzone findOneById(int $id) Return the first ChildDelivzone filtered by the id column
* @method ChildDelivzone findOneByAreaId(int $area_id) Return the first ChildDelivzone filtered by the area_id column
* @method ChildDelivzone findOneByDelivery(string $delivery) Return the first ChildDelivzone filtered by the delivery column
* @method ChildDelivzone findOneByCreatedAt(string $created_at) Return the first ChildDelivzone filtered by the created_at column
* @method ChildDelivzone findOneByUpdatedAt(string $updated_at) Return the first ChildDelivzone filtered by the updated_at column
* @method ChildAreaDeliveryModule findOne(ConnectionInterface $con = null) Return the first ChildAreaDeliveryModule matching the query
* @method ChildAreaDeliveryModule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAreaDeliveryModule matching the query, or a new ChildAreaDeliveryModule object populated from the query conditions when no match is found
*
* @method array findById(int $id) Return ChildDelivzone objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildDelivzone objects filtered by the area_id column
* @method array findByDelivery(string $delivery) Return ChildDelivzone objects filtered by the delivery column
* @method array findByCreatedAt(string $created_at) Return ChildDelivzone objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildDelivzone objects filtered by the updated_at column
* @method ChildAreaDeliveryModule findOneById(int $id) Return the first ChildAreaDeliveryModule filtered by the id column
* @method ChildAreaDeliveryModule findOneByAreaId(int $area_id) Return the first ChildAreaDeliveryModule filtered by the area_id column
* @method ChildAreaDeliveryModule findOneByDeliveryModuleId(int $delivery_module_id) Return the first ChildAreaDeliveryModule filtered by the delivery_module_id column
* @method ChildAreaDeliveryModule findOneByCreatedAt(string $created_at) Return the first ChildAreaDeliveryModule filtered by the created_at column
* @method ChildAreaDeliveryModule findOneByUpdatedAt(string $updated_at) Return the first ChildAreaDeliveryModule filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAreaDeliveryModule objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildAreaDeliveryModule objects filtered by the area_id column
* @method array findByDeliveryModuleId(int $delivery_module_id) Return ChildAreaDeliveryModule objects filtered by the delivery_module_id column
* @method array findByCreatedAt(string $created_at) Return ChildAreaDeliveryModule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAreaDeliveryModule objects filtered by the updated_at column
*
*/
abstract class DelivzoneQuery extends ModelCriteria
abstract class AreaDeliveryModuleQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\DelivzoneQuery object.
* Initializes internal state of \Thelia\Model\Base\AreaDeliveryModuleQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Delivzone', $modelAlias = null)
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AreaDeliveryModule', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildDelivzoneQuery object.
* Returns a new ChildAreaDeliveryModuleQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildDelivzoneQuery
* @return ChildAreaDeliveryModuleQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\DelivzoneQuery) {
if ($criteria instanceof \Thelia\Model\AreaDeliveryModuleQuery) {
return $criteria;
}
$query = new \Thelia\Model\DelivzoneQuery();
$query = new \Thelia\Model\AreaDeliveryModuleQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -108,19 +112,19 @@ abstract class DelivzoneQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildDelivzone|array|mixed the result, formatted by the current formatter
* @return ChildAreaDeliveryModule|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = DelivzoneTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
if ((null !== ($obj = AreaDeliveryModuleTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -139,11 +143,11 @@ abstract class DelivzoneQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildDelivzone A model object, or null if the key is not found
* @return ChildAreaDeliveryModule A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY, CREATED_AT, UPDATED_AT FROM delivzone WHERE ID = :p0';
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODULE_ID, CREATED_AT, UPDATED_AT FROM area_delivery_module WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -154,9 +158,9 @@ abstract class DelivzoneQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildDelivzone();
$obj = new ChildAreaDeliveryModule();
$obj->hydrate($row);
DelivzoneTableMap::addInstanceToPool($obj, (string) $key);
AreaDeliveryModuleTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -169,7 +173,7 @@ abstract class DelivzoneQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildDelivzone|array|mixed the result, formatted by the current formatter
* @return ChildAreaDeliveryModule|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -211,12 +215,12 @@ abstract class DelivzoneQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(DelivzoneTableMap::ID, $key, Criteria::EQUAL);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -224,12 +228,12 @@ abstract class DelivzoneQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(DelivzoneTableMap::ID, $keys, Criteria::IN);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -248,18 +252,18 @@ abstract class DelivzoneQuery 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 ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(DelivzoneTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(DelivzoneTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -270,7 +274,7 @@ abstract class DelivzoneQuery extends ModelCriteria
}
}
return $this->addUsingAlias(DelivzoneTableMap::ID, $id, $comparison);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $id, $comparison);
}
/**
@@ -291,18 +295,18 @@ abstract class DelivzoneQuery 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 ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -313,36 +317,50 @@ abstract class DelivzoneQuery extends ModelCriteria
}
}
return $this->addUsingAlias(DelivzoneTableMap::AREA_ID, $areaId, $comparison);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery column
* Filter the query on the delivery_module_id column
*
* Example usage:
* <code>
* $query->filterByDelivery('fooValue'); // WHERE delivery = 'fooValue'
* $query->filterByDelivery('%fooValue%'); // WHERE delivery LIKE '%fooValue%'
* $query->filterByDeliveryModuleId(1234); // WHERE delivery_module_id = 1234
* $query->filterByDeliveryModuleId(array(12, 34)); // WHERE delivery_module_id IN (12, 34)
* $query->filterByDeliveryModuleId(array('min' => 12)); // WHERE delivery_module_id > 12
* </code>
*
* @param string $delivery The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @see filterByModule()
*
* @param mixed $deliveryModuleId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByDelivery($delivery = null, $comparison = null)
public function filterByDeliveryModuleId($deliveryModuleId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($delivery)) {
if (is_array($deliveryModuleId)) {
$useMinMax = false;
if (isset($deliveryModuleId['min'])) {
$this->addUsingAlias(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModuleId['max'])) {
$this->addUsingAlias(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $delivery)) {
$delivery = str_replace('*', '%', $delivery);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(DelivzoneTableMap::DELIVERY, $delivery, $comparison);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $deliveryModuleId, $comparison);
}
/**
@@ -363,18 +381,18 @@ abstract class DelivzoneQuery 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 ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
$this->addUsingAlias(DelivzoneTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(DelivzoneTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -385,7 +403,7 @@ abstract class DelivzoneQuery extends ModelCriteria
}
}
return $this->addUsingAlias(DelivzoneTableMap::CREATED_AT, $createdAt, $comparison);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -406,18 +424,18 @@ abstract class DelivzoneQuery 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 ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
$this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(AreaDeliveryModuleTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -428,7 +446,7 @@ abstract class DelivzoneQuery extends ModelCriteria
}
}
return $this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, $updatedAt, $comparison);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
@@ -437,20 +455,20 @@ abstract class DelivzoneQuery extends ModelCriteria
* @param \Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \Thelia\Model\Area) {
return $this
->addUsingAlias(DelivzoneTableMap::AREA_ID, $area->getId(), $comparison);
->addUsingAlias(AreaDeliveryModuleTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(DelivzoneTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(AreaDeliveryModuleTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \Thelia\Model\Area or Collection');
}
@@ -462,9 +480,9 @@ abstract class DelivzoneQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
@@ -499,7 +517,7 @@ abstract class DelivzoneQuery extends ModelCriteria
*
* @return \Thelia\Model\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
@@ -507,23 +525,98 @@ abstract class DelivzoneQuery extends ModelCriteria
}
/**
* Exclude object from result
* Filter the query by a related \Thelia\Model\Module object
*
* @param ChildDelivzone $delivzone Object to remove from the list of results
* @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function prune($delivzone = null)
public function filterByModule($module, $comparison = null)
{
if ($delivzone) {
$this->addUsingAlias(DelivzoneTableMap::ID, $delivzone->getId(), Criteria::NOT_EQUAL);
if ($module instanceof \Thelia\Model\Module) {
return $this
->addUsingAlias(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $module->getId(), $comparison);
} elseif ($module instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByModule() only accepts arguments of type \Thelia\Model\Module or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Module relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function joinModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Module');
// 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, 'Module');
}
return $this;
}
/**
* Deletes all rows from the delivzone table.
* Use the Module relation Module 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\ModuleQuery A secondary query class using the current class as primary query
*/
public function useModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Module', '\Thelia\Model\ModuleQuery');
}
/**
* Exclude object from result
*
* @param ChildAreaDeliveryModule $areaDeliveryModule Object to remove from the list of results
*
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function prune($areaDeliveryModule = null)
{
if ($areaDeliveryModule) {
$this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $areaDeliveryModule->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the area_delivery_module table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -531,7 +624,7 @@ abstract class DelivzoneQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -542,8 +635,8 @@ abstract class DelivzoneQuery extends ModelCriteria
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
DelivzoneTableMap::clearInstancePool();
DelivzoneTableMap::clearRelatedInstancePool();
AreaDeliveryModuleTableMap::clearInstancePool();
AreaDeliveryModuleTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -555,9 +648,9 @@ abstract class DelivzoneQuery extends ModelCriteria
}
/**
* Performs a DELETE on the database, given a ChildDelivzone or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ChildAreaDeliveryModule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildDelivzone object or primary key or array of primary keys
* @param mixed $values Criteria or ChildAreaDeliveryModule 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
@@ -568,13 +661,13 @@ abstract class DelivzoneQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(DelivzoneTableMap::DATABASE_NAME);
$criteria->setDbName(AreaDeliveryModuleTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -584,10 +677,10 @@ abstract class DelivzoneQuery extends ModelCriteria
$con->beginTransaction();
DelivzoneTableMap::removeInstanceFromPool($criteria);
AreaDeliveryModuleTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
DelivzoneTableMap::clearRelatedInstancePool();
AreaDeliveryModuleTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -604,11 +697,11 @@ abstract class DelivzoneQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(DelivzoneTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -616,51 +709,51 @@ abstract class DelivzoneQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(DelivzoneTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(AreaDeliveryModuleTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(DelivzoneTableMap::UPDATED_AT);
return $this->addDescendingOrderByColumn(AreaDeliveryModuleTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(DelivzoneTableMap::UPDATED_AT);
return $this->addAscendingOrderByColumn(AreaDeliveryModuleTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(DelivzoneTableMap::CREATED_AT);
return $this->addDescendingOrderByColumn(AreaDeliveryModuleTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildDelivzoneQuery The current query, for fluid interface
* @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(DelivzoneTableMap::CREATED_AT);
return $this->addAscendingOrderByColumn(AreaDeliveryModuleTableMap::CREATED_AT);
}
} // DelivzoneQuery
} // AreaDeliveryModuleQuery

View File

@@ -23,13 +23,13 @@ use Thelia\Model\Map\AreaTableMap;
*
* @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 orderByPostage($order = Criteria::ASC) Order by the postage column
* @method ChildAreaQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAreaQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAreaQuery groupById() Group by the id column
* @method ChildAreaQuery groupByName() Group by the name column
* @method ChildAreaQuery groupByUnit() Group by the unit column
* @method ChildAreaQuery groupByPostage() Group by the postage column
* @method ChildAreaQuery groupByCreatedAt() Group by the created_at column
* @method ChildAreaQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -41,22 +41,22 @@ use Thelia\Model\Map\AreaTableMap;
* @method ChildAreaQuery rightJoinCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Country relation
* @method ChildAreaQuery innerJoinCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the Country relation
*
* @method ChildAreaQuery leftJoinDelivzone($relationAlias = null) Adds a LEFT JOIN clause to the query using the Delivzone relation
* @method ChildAreaQuery rightJoinDelivzone($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Delivzone relation
* @method ChildAreaQuery innerJoinDelivzone($relationAlias = null) Adds a INNER JOIN clause to the query using the Delivzone relation
* @method ChildAreaQuery leftJoinAreaDeliveryModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the AreaDeliveryModule relation
* @method ChildAreaQuery rightJoinAreaDeliveryModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AreaDeliveryModule relation
* @method ChildAreaQuery innerJoinAreaDeliveryModule($relationAlias = null) Adds a INNER JOIN clause to the query using the AreaDeliveryModule relation
*
* @method ChildArea findOne(ConnectionInterface $con = null) Return the first ChildArea matching the query
* @method ChildArea findOneOrCreate(ConnectionInterface $con = null) Return the first ChildArea matching the query, or a new ChildArea object populated from the query conditions when no match is found
*
* @method ChildArea findOneById(int $id) Return the first ChildArea filtered by the id column
* @method ChildArea findOneByName(string $name) Return the first ChildArea filtered by the name column
* @method ChildArea findOneByUnit(double $unit) Return the first ChildArea filtered by the unit column
* @method ChildArea findOneByPostage(double $postage) Return the first ChildArea filtered by the postage column
* @method ChildArea findOneByCreatedAt(string $created_at) Return the first ChildArea filtered by the created_at column
* @method ChildArea findOneByUpdatedAt(string $updated_at) Return the first ChildArea filtered by the updated_at column
*
* @method array findById(int $id) Return ChildArea objects filtered by the id column
* @method array findByName(string $name) Return ChildArea objects filtered by the name column
* @method array findByUnit(double $unit) Return ChildArea objects filtered by the unit column
* @method array findByPostage(double $postage) Return ChildArea objects filtered by the postage 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
*
@@ -147,7 +147,7 @@ abstract class AreaQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, NAME, UNIT, CREATED_AT, UPDATED_AT FROM area WHERE ID = :p0';
$sql = 'SELECT ID, NAME, POSTAGE, CREATED_AT, UPDATED_AT FROM area WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -307,16 +307,16 @@ abstract class AreaQuery extends ModelCriteria
}
/**
* Filter the query on the unit column
* Filter the query on the postage column
*
* Example usage:
* <code>
* $query->filterByUnit(1234); // WHERE unit = 1234
* $query->filterByUnit(array(12, 34)); // WHERE unit IN (12, 34)
* $query->filterByUnit(array('min' => 12)); // WHERE unit > 12
* $query->filterByPostage(1234); // WHERE postage = 1234
* $query->filterByPostage(array(12, 34)); // WHERE postage IN (12, 34)
* $query->filterByPostage(array('min' => 12)); // WHERE postage > 12
* </code>
*
* @param mixed $unit The value to use as filter.
* @param mixed $postage 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.
@@ -324,16 +324,16 @@ abstract class AreaQuery extends ModelCriteria
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function filterByUnit($unit = null, $comparison = null)
public function filterByPostage($postage = null, $comparison = null)
{
if (is_array($unit)) {
if (is_array($postage)) {
$useMinMax = false;
if (isset($unit['min'])) {
$this->addUsingAlias(AreaTableMap::UNIT, $unit['min'], Criteria::GREATER_EQUAL);
if (isset($postage['min'])) {
$this->addUsingAlias(AreaTableMap::POSTAGE, $postage['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($unit['max'])) {
$this->addUsingAlias(AreaTableMap::UNIT, $unit['max'], Criteria::LESS_EQUAL);
if (isset($postage['max'])) {
$this->addUsingAlias(AreaTableMap::POSTAGE, $postage['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -344,7 +344,7 @@ abstract class AreaQuery extends ModelCriteria
}
}
return $this->addUsingAlias(AreaTableMap::UNIT, $unit, $comparison);
return $this->addUsingAlias(AreaTableMap::POSTAGE, $postage, $comparison);
}
/**
@@ -507,40 +507,40 @@ abstract class AreaQuery extends ModelCriteria
}
/**
* Filter the query by a related \Thelia\Model\Delivzone object
* Filter the query by a related \Thelia\Model\AreaDeliveryModule object
*
* @param \Thelia\Model\Delivzone|ObjectCollection $delivzone the related object to use as filter
* @param \Thelia\Model\AreaDeliveryModule|ObjectCollection $areaDeliveryModule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function filterByDelivzone($delivzone, $comparison = null)
public function filterByAreaDeliveryModule($areaDeliveryModule, $comparison = null)
{
if ($delivzone instanceof \Thelia\Model\Delivzone) {
if ($areaDeliveryModule instanceof \Thelia\Model\AreaDeliveryModule) {
return $this
->addUsingAlias(AreaTableMap::ID, $delivzone->getAreaId(), $comparison);
} elseif ($delivzone instanceof ObjectCollection) {
->addUsingAlias(AreaTableMap::ID, $areaDeliveryModule->getAreaId(), $comparison);
} elseif ($areaDeliveryModule instanceof ObjectCollection) {
return $this
->useDelivzoneQuery()
->filterByPrimaryKeys($delivzone->getPrimaryKeys())
->useAreaDeliveryModuleQuery()
->filterByPrimaryKeys($areaDeliveryModule->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByDelivzone() only accepts arguments of type \Thelia\Model\Delivzone or Collection');
throw new PropelException('filterByAreaDeliveryModule() only accepts arguments of type \Thelia\Model\AreaDeliveryModule or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Delivzone relation
* Adds a JOIN clause to the query using the AreaDeliveryModule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAreaQuery The current query, for fluid interface
*/
public function joinDelivzone($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinAreaDeliveryModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Delivzone');
$relationMap = $tableMap->getRelation('AreaDeliveryModule');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -555,14 +555,14 @@ abstract class AreaQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Delivzone');
$this->addJoinObject($join, 'AreaDeliveryModule');
}
return $this;
}
/**
* Use the Delivzone relation Delivzone object
* Use the AreaDeliveryModule relation AreaDeliveryModule object
*
* @see useQuery()
*
@@ -570,13 +570,13 @@ abstract class AreaQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\DelivzoneQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\AreaDeliveryModuleQuery A secondary query class using the current class as primary query
*/
public function useDelivzoneQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useAreaDeliveryModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinDelivzone($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Delivzone', '\Thelia\Model\DelivzoneQuery');
->joinAreaDeliveryModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AreaDeliveryModule', '\Thelia\Model\AreaDeliveryModuleQuery');
}
/**

View File

@@ -70,6 +70,12 @@ abstract class ContentFolder implements ActiveRecordInterface
*/
protected $folder_id;
/**
* The value for the default_folder field.
* @var boolean
*/
protected $default_folder;
/**
* The value for the created_at field.
* @var string
@@ -376,6 +382,17 @@ abstract class ContentFolder implements ActiveRecordInterface
return $this->folder_id;
}
/**
* Get the [default_folder] column value.
*
* @return boolean
*/
public function getDefaultFolder()
{
return $this->default_folder;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -466,6 +483,35 @@ abstract class ContentFolder implements ActiveRecordInterface
return $this;
} // setFolderId()
/**
* Sets the value of the [default_folder] column.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
*
* @param boolean|integer|string $v The new value
* @return \Thelia\Model\ContentFolder The current object (for fluent API support)
*/
public function setDefaultFolder($v)
{
if ($v !== null) {
if (is_string($v)) {
$v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
} else {
$v = (boolean) $v;
}
}
if ($this->default_folder !== $v) {
$this->default_folder = $v;
$this->modifiedColumns[] = ContentFolderTableMap::DEFAULT_FOLDER;
}
return $this;
} // setDefaultFolder()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -551,13 +597,16 @@ abstract class ContentFolder implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ContentFolderTableMap::translateFieldName('FolderId', TableMap::TYPE_PHPNAME, $indexType)];
$this->folder_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ContentFolderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ContentFolderTableMap::translateFieldName('DefaultFolder', TableMap::TYPE_PHPNAME, $indexType)];
$this->default_folder = (null !== $col) ? (boolean) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ContentFolderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ContentFolderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ContentFolderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -570,7 +619,7 @@ abstract class ContentFolder implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 4; // 4 = ContentFolderTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 5; // 5 = ContentFolderTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ContentFolder object", 0, $e);
@@ -819,6 +868,9 @@ abstract class ContentFolder implements ActiveRecordInterface
if ($this->isColumnModified(ContentFolderTableMap::FOLDER_ID)) {
$modifiedColumns[':p' . $index++] = 'FOLDER_ID';
}
if ($this->isColumnModified(ContentFolderTableMap::DEFAULT_FOLDER)) {
$modifiedColumns[':p' . $index++] = 'DEFAULT_FOLDER';
}
if ($this->isColumnModified(ContentFolderTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -842,6 +894,9 @@ abstract class ContentFolder implements ActiveRecordInterface
case 'FOLDER_ID':
$stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT);
break;
case 'DEFAULT_FOLDER':
$stmt->bindValue($identifier, (int) $this->default_folder, PDO::PARAM_INT);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break;
@@ -910,9 +965,12 @@ abstract class ContentFolder implements ActiveRecordInterface
return $this->getFolderId();
break;
case 2:
return $this->getCreatedAt();
return $this->getDefaultFolder();
break;
case 3:
return $this->getCreatedAt();
break;
case 4:
return $this->getUpdatedAt();
break;
default:
@@ -946,8 +1004,9 @@ abstract class ContentFolder implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getContentId(),
$keys[1] => $this->getFolderId(),
$keys[2] => $this->getCreatedAt(),
$keys[3] => $this->getUpdatedAt(),
$keys[2] => $this->getDefaultFolder(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1003,9 +1062,12 @@ abstract class ContentFolder implements ActiveRecordInterface
$this->setFolderId($value);
break;
case 2:
$this->setCreatedAt($value);
$this->setDefaultFolder($value);
break;
case 3:
$this->setCreatedAt($value);
break;
case 4:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1034,8 +1096,9 @@ abstract class ContentFolder implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setContentId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setFolderId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
if (array_key_exists($keys[2], $arr)) $this->setDefaultFolder($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
}
/**
@@ -1049,6 +1112,7 @@ abstract class ContentFolder implements ActiveRecordInterface
if ($this->isColumnModified(ContentFolderTableMap::CONTENT_ID)) $criteria->add(ContentFolderTableMap::CONTENT_ID, $this->content_id);
if ($this->isColumnModified(ContentFolderTableMap::FOLDER_ID)) $criteria->add(ContentFolderTableMap::FOLDER_ID, $this->folder_id);
if ($this->isColumnModified(ContentFolderTableMap::DEFAULT_FOLDER)) $criteria->add(ContentFolderTableMap::DEFAULT_FOLDER, $this->default_folder);
if ($this->isColumnModified(ContentFolderTableMap::CREATED_AT)) $criteria->add(ContentFolderTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ContentFolderTableMap::UPDATED_AT)) $criteria->add(ContentFolderTableMap::UPDATED_AT, $this->updated_at);
@@ -1123,6 +1187,7 @@ abstract class ContentFolder implements ActiveRecordInterface
{
$copyObj->setContentId($this->getContentId());
$copyObj->setFolderId($this->getFolderId());
$copyObj->setDefaultFolder($this->getDefaultFolder());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1261,6 +1326,7 @@ abstract class ContentFolder implements ActiveRecordInterface
{
$this->content_id = null;
$this->folder_id = null;
$this->default_folder = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -23,11 +23,13 @@ use Thelia\Model\Map\ContentFolderTableMap;
*
* @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 orderByDefaultFolder($order = Criteria::ASC) Order by the default_folder column
* @method ChildContentFolderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildContentFolderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildContentFolderQuery groupByContentId() Group by the content_id column
* @method ChildContentFolderQuery groupByFolderId() Group by the folder_id column
* @method ChildContentFolderQuery groupByDefaultFolder() Group by the default_folder column
* @method ChildContentFolderQuery groupByCreatedAt() Group by the created_at column
* @method ChildContentFolderQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -48,11 +50,13 @@ use Thelia\Model\Map\ContentFolderTableMap;
*
* @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 findOneByDefaultFolder(boolean $default_folder) Return the first ChildContentFolder filtered by the default_folder column
* @method ChildContentFolder findOneByCreatedAt(string $created_at) Return the first ChildContentFolder filtered by the created_at column
* @method ChildContentFolder findOneByUpdatedAt(string $updated_at) Return the first ChildContentFolder filtered by the updated_at column
*
* @method array findByContentId(int $content_id) Return ChildContentFolder objects filtered by the content_id column
* @method array findByFolderId(int $folder_id) Return ChildContentFolder objects filtered by the folder_id column
* @method array findByDefaultFolder(boolean $default_folder) Return ChildContentFolder objects filtered by the default_folder 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
*
@@ -143,7 +147,7 @@ abstract class ContentFolderQuery extends ModelCriteria
*/
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, DEFAULT_FOLDER, 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);
@@ -330,6 +334,33 @@ abstract class ContentFolderQuery extends ModelCriteria
return $this->addUsingAlias(ContentFolderTableMap::FOLDER_ID, $folderId, $comparison);
}
/**
* Filter the query on the default_folder column
*
* Example usage:
* <code>
* $query->filterByDefaultFolder(true); // WHERE default_folder = true
* $query->filterByDefaultFolder('yes'); // WHERE default_folder = true
* </code>
*
* @param boolean|string $defaultFolder The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildContentFolderQuery The current query, for fluid interface
*/
public function filterByDefaultFolder($defaultFolder = null, $comparison = null)
{
if (is_string($defaultFolder)) {
$default_folder = in_array(strtolower($defaultFolder), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ContentFolderTableMap::DEFAULT_FOLDER, $defaultFolder, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -987,10 +987,9 @@ abstract class Currency implements ActiveRecordInterface
if ($this->ordersScheduledForDeletion !== null) {
if (!$this->ordersScheduledForDeletion->isEmpty()) {
foreach ($this->ordersScheduledForDeletion as $order) {
// need to save related object because we set the relation to null
$order->save($con);
}
\Thelia\Model\OrderQuery::create()
->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->ordersScheduledForDeletion = null;
}
}
@@ -1758,7 +1757,7 @@ abstract class Currency implements ActiveRecordInterface
$this->ordersScheduledForDeletion = clone $this->collOrders;
$this->ordersScheduledForDeletion->clear();
}
$this->ordersScheduledForDeletion[]= $order;
$this->ordersScheduledForDeletion[]= clone $order;
$order->setCurrency(null);
}
@@ -1807,10 +1806,10 @@ abstract class Currency implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior);
$query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
@@ -1832,10 +1831,10 @@ abstract class Currency implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior);
$query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
@@ -1865,6 +1864,81 @@ abstract class Currency implements ActiveRecordInterface
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Currency is new, it will return
* an empty collection; or if this Currency has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Currency.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Currency is new, it will return
* an empty collection; or if this Currency has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Currency.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Currency is new, it will return
* an empty collection; or if this Currency has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Currency.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Lang', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* Clears out the collCarts collection
*

View File

@@ -596,7 +596,7 @@ abstract class CurrencyQuery extends ModelCriteria
*
* @return ChildCurrencyQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
@@ -631,7 +631,7 @@ abstract class CurrencyQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)

View File

@@ -2552,10 +2552,10 @@ abstract class Customer implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior);
$query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
@@ -2577,10 +2577,10 @@ abstract class Customer implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior);
$query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
@@ -2610,6 +2610,81 @@ abstract class Customer implements ActiveRecordInterface
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Customer is new, it will return
* an empty collection; or if this Customer has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Customer.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Customer is new, it will return
* an empty collection; or if this Customer has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Customer.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Customer is new, it will return
* an empty collection; or if this Customer has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Customer.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Lang', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* Clears out the collCarts collection
*

View File

@@ -10,6 +10,7 @@ use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException;
@@ -18,6 +19,8 @@ use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Lang as ChildLang;
use Thelia\Model\LangQuery as ChildLangQuery;
use Thelia\Model\Order as ChildOrder;
use Thelia\Model\OrderQuery as ChildOrderQuery;
use Thelia\Model\Map\LangTableMap;
abstract class Lang implements ActiveRecordInterface
@@ -144,6 +147,12 @@ abstract class Lang implements ActiveRecordInterface
*/
protected $updated_at;
/**
* @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects.
*/
protected $collOrders;
protected $collOrdersPartial;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -152,6 +161,12 @@ abstract class Lang implements ActiveRecordInterface
*/
protected $alreadyInSave = false;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $ordersScheduledForDeletion = null;
/**
* Initializes internal state of Thelia\Model\Base\Lang object.
*/
@@ -1060,6 +1075,8 @@ abstract class Lang implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->collOrders = null;
} // if (deep)
}
@@ -1193,6 +1210,23 @@ abstract class Lang implements ActiveRecordInterface
$this->resetModified();
}
if ($this->ordersScheduledForDeletion !== null) {
if (!$this->ordersScheduledForDeletion->isEmpty()) {
\Thelia\Model\OrderQuery::create()
->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->ordersScheduledForDeletion = null;
}
}
if ($this->collOrders !== null) {
foreach ($this->collOrders as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
@@ -1444,10 +1478,11 @@ abstract class Lang implements ActiveRecordInterface
* Defaults to TableMap::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Lang'][$this->getPrimaryKey()])) {
return '*RECURSION*';
@@ -1477,6 +1512,11 @@ abstract class Lang implements ActiveRecordInterface
$result[$key] = $virtualColumn;
}
if ($includeForeignObjects) {
if (null !== $this->collOrders) {
$result['Orders'] = $this->collOrders->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
return $result;
}
@@ -1697,6 +1737,20 @@ abstract class Lang implements ActiveRecordInterface
$copyObj->setPosition($this->getPosition());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
foreach ($this->getOrders() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addOrder($relObj->copy($deepCopy));
}
}
} // if ($deepCopy)
if ($makeNew) {
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
@@ -1725,6 +1779,415 @@ abstract class Lang implements ActiveRecordInterface
return $copyObj;
}
/**
* Initializes a collection based on the name of a relation.
* Avoids crafting an 'init[$relationName]s' method name
* that wouldn't work when StandardEnglishPluralizer is used.
*
* @param string $relationName The name of the relation to initialize
* @return void
*/
public function initRelation($relationName)
{
if ('Order' == $relationName) {
return $this->initOrders();
}
}
/**
* Clears out the collOrders collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addOrders()
*/
public function clearOrders()
{
$this->collOrders = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collOrders collection loaded partially.
*/
public function resetPartialOrders($v = true)
{
$this->collOrdersPartial = $v;
}
/**
* Initializes the collOrders collection.
*
* By default this just sets the collOrders collection to an empty array (like clearcollOrders());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
* @param boolean $overrideExisting If set to true, the method call initializes
* the collection even if it is not empty
*
* @return void
*/
public function initOrders($overrideExisting = true)
{
if (null !== $this->collOrders && !$overrideExisting) {
return;
}
$this->collOrders = new ObjectCollection();
$this->collOrders->setModel('\Thelia\Model\Order');
}
/**
* Gets an array of ChildOrder objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this ChildLang is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @return Collection|ChildOrder[] List of ChildOrder objects
* @throws PropelException
*/
public function getOrders($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collOrdersPartial && !$this->isNew();
if (null === $this->collOrders || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrders) {
// return empty collection
$this->initOrders();
} else {
$collOrders = ChildOrderQuery::create(null, $criteria)
->filterByLang($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collOrdersPartial && count($collOrders)) {
$this->initOrders(false);
foreach ($collOrders as $obj) {
if (false == $this->collOrders->contains($obj)) {
$this->collOrders->append($obj);
}
}
$this->collOrdersPartial = true;
}
$collOrders->getInternalIterator()->rewind();
return $collOrders;
}
if ($partial && $this->collOrders) {
foreach ($this->collOrders as $obj) {
if ($obj->isNew()) {
$collOrders[] = $obj;
}
}
}
$this->collOrders = $collOrders;
$this->collOrdersPartial = false;
}
}
return $this->collOrders;
}
/**
* Sets a collection of Order objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param Collection $orders A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildLang The current object (for fluent API support)
*/
public function setOrders(Collection $orders, ConnectionInterface $con = null)
{
$ordersToDelete = $this->getOrders(new Criteria(), $con)->diff($orders);
$this->ordersScheduledForDeletion = $ordersToDelete;
foreach ($ordersToDelete as $orderRemoved) {
$orderRemoved->setLang(null);
}
$this->collOrders = null;
foreach ($orders as $order) {
$this->addOrder($order);
}
$this->collOrders = $orders;
$this->collOrdersPartial = false;
return $this;
}
/**
* Returns the number of related Order objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related Order objects.
* @throws PropelException
*/
public function countOrders(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collOrdersPartial && !$this->isNew();
if (null === $this->collOrders || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrders) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getOrders());
}
$query = ChildOrderQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByLang($this)
->count($con);
}
return count($this->collOrders);
}
/**
* Method called to associate a ChildOrder object to this object
* through the ChildOrder foreign key attribute.
*
* @param ChildOrder $l ChildOrder
* @return \Thelia\Model\Lang The current object (for fluent API support)
*/
public function addOrder(ChildOrder $l)
{
if ($this->collOrders === null) {
$this->initOrders();
$this->collOrdersPartial = true;
}
if (!in_array($l, $this->collOrders->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddOrder($l);
}
return $this;
}
/**
* @param Order $order The order object to add.
*/
protected function doAddOrder($order)
{
$this->collOrders[]= $order;
$order->setLang($this);
}
/**
* @param Order $order The order object to remove.
* @return ChildLang The current object (for fluent API support)
*/
public function removeOrder($order)
{
if ($this->getOrders()->contains($order)) {
$this->collOrders->remove($this->collOrders->search($order));
if (null === $this->ordersScheduledForDeletion) {
$this->ordersScheduledForDeletion = clone $this->collOrders;
$this->ordersScheduledForDeletion->clear();
}
$this->ordersScheduledForDeletion[]= clone $order;
$order->setLang(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Currency', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Customer', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderStatus', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Lang is new, it will return
* an empty collection; or if this Lang has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in Lang.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* Clears the current object and sets all attributes to their default values
*/
@@ -1764,8 +2227,17 @@ abstract class Lang implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collOrders) {
foreach ($this->collOrders as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep)
if ($this->collOrders instanceof Collection) {
$this->collOrders->clearIterator();
}
$this->collOrders = null;
}
/**

View File

@@ -7,6 +7,9 @@ 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\Lang as ChildLang;
@@ -54,6 +57,10 @@ use Thelia\Model\Map\LangTableMap;
* @method ChildLangQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildLangQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildLangQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation
* @method ChildLangQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
* @method ChildLangQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
*
* @method ChildLang findOne(ConnectionInterface $con = null) Return the first ChildLang matching the query
* @method ChildLang findOneOrCreate(ConnectionInterface $con = null) Return the first ChildLang matching the query, or a new ChildLang object populated from the query conditions when no match is found
*
@@ -764,6 +771,79 @@ abstract class LangQuery extends ModelCriteria
return $this->addUsingAlias(LangTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildLangQuery The current query, for fluid interface
*/
public function filterByOrder($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(LangTableMap::ID, $order->getLangId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Order relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildLangQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Order');
}
return $this;
}
/**
* Use the Order relation Order object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery');
}
/**
* Exclude object from result
*

File diff suppressed because it is too large Load Diff

View File

@@ -44,6 +44,18 @@ use Thelia\Model\Map\ModuleTableMap;
* @method ChildModuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildModuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildModuleQuery leftJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByPaymentModuleId relation
* @method ChildModuleQuery rightJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByPaymentModuleId relation
* @method ChildModuleQuery innerJoinOrderRelatedByPaymentModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByPaymentModuleId relation
*
* @method ChildModuleQuery leftJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation
* @method ChildModuleQuery rightJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation
* @method ChildModuleQuery innerJoinOrderRelatedByDeliveryModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation
*
* @method ChildModuleQuery leftJoinAreaDeliveryModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the AreaDeliveryModule relation
* @method ChildModuleQuery rightJoinAreaDeliveryModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AreaDeliveryModule relation
* @method ChildModuleQuery innerJoinAreaDeliveryModule($relationAlias = null) Adds a INNER JOIN clause to the query using the AreaDeliveryModule relation
*
* @method ChildModuleQuery leftJoinGroupModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
@@ -557,6 +569,225 @@ abstract class ModuleQuery extends ModelCriteria
return $this->addUsingAlias(ModuleTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function filterByOrderRelatedByPaymentModuleId($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(ModuleTableMap::ID, $order->getPaymentModuleId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderRelatedByPaymentModuleIdQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrderRelatedByPaymentModuleId() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderRelatedByPaymentModuleId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function joinOrderRelatedByPaymentModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderRelatedByPaymentModuleId');
// 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, 'OrderRelatedByPaymentModuleId');
}
return $this;
}
/**
* Use the OrderRelatedByPaymentModuleId relation Order object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderRelatedByPaymentModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderRelatedByPaymentModuleId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByPaymentModuleId', '\Thelia\Model\OrderQuery');
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function filterByOrderRelatedByDeliveryModuleId($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(ModuleTableMap::ID, $order->getDeliveryModuleId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderRelatedByDeliveryModuleIdQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrderRelatedByDeliveryModuleId() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderRelatedByDeliveryModuleId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function joinOrderRelatedByDeliveryModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderRelatedByDeliveryModuleId');
// 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, 'OrderRelatedByDeliveryModuleId');
}
return $this;
}
/**
* Use the OrderRelatedByDeliveryModuleId relation Order object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderRelatedByDeliveryModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderRelatedByDeliveryModuleId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByDeliveryModuleId', '\Thelia\Model\OrderQuery');
}
/**
* Filter the query by a related \Thelia\Model\AreaDeliveryModule object
*
* @param \Thelia\Model\AreaDeliveryModule|ObjectCollection $areaDeliveryModule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function filterByAreaDeliveryModule($areaDeliveryModule, $comparison = null)
{
if ($areaDeliveryModule instanceof \Thelia\Model\AreaDeliveryModule) {
return $this
->addUsingAlias(ModuleTableMap::ID, $areaDeliveryModule->getDeliveryModuleId(), $comparison);
} elseif ($areaDeliveryModule instanceof ObjectCollection) {
return $this
->useAreaDeliveryModuleQuery()
->filterByPrimaryKeys($areaDeliveryModule->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAreaDeliveryModule() only accepts arguments of type \Thelia\Model\AreaDeliveryModule or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AreaDeliveryModule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function joinAreaDeliveryModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AreaDeliveryModule');
// 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, 'AreaDeliveryModule');
}
return $this;
}
/**
* Use the AreaDeliveryModule relation AreaDeliveryModule 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\AreaDeliveryModuleQuery A secondary query class using the current class as primary query
*/
public function useAreaDeliveryModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAreaDeliveryModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AreaDeliveryModule', '\Thelia\Model\AreaDeliveryModuleQuery');
}
/**
* Filter the query by a related \Thelia\Model\GroupModule object
*

File diff suppressed because it is too large Load Diff

View File

@@ -144,14 +144,14 @@ abstract class OrderAddress implements ActiveRecordInterface
/**
* @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects.
*/
protected $collOrdersRelatedByAddressInvoice;
protected $collOrdersRelatedByAddressInvoicePartial;
protected $collOrdersRelatedByInvoiceOrderAddressId;
protected $collOrdersRelatedByInvoiceOrderAddressIdPartial;
/**
* @var ObjectCollection|ChildOrder[] Collection to store aggregation of ChildOrder objects.
*/
protected $collOrdersRelatedByAddressDelivery;
protected $collOrdersRelatedByAddressDeliveryPartial;
protected $collOrdersRelatedByDeliveryOrderAddressId;
protected $collOrdersRelatedByDeliveryOrderAddressIdPartial;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -165,13 +165,13 @@ abstract class OrderAddress implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $ordersRelatedByAddressInvoiceScheduledForDeletion = null;
protected $ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $ordersRelatedByAddressDeliveryScheduledForDeletion = null;
protected $ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = null;
/**
* Initializes internal state of Thelia\Model\Base\OrderAddress object.
@@ -1046,9 +1046,9 @@ abstract class OrderAddress implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->collOrdersRelatedByAddressInvoice = null;
$this->collOrdersRelatedByInvoiceOrderAddressId = null;
$this->collOrdersRelatedByAddressDelivery = null;
$this->collOrdersRelatedByDeliveryOrderAddressId = null;
} // if (deep)
}
@@ -1183,36 +1183,34 @@ abstract class OrderAddress implements ActiveRecordInterface
$this->resetModified();
}
if ($this->ordersRelatedByAddressInvoiceScheduledForDeletion !== null) {
if (!$this->ordersRelatedByAddressInvoiceScheduledForDeletion->isEmpty()) {
foreach ($this->ordersRelatedByAddressInvoiceScheduledForDeletion as $orderRelatedByAddressInvoice) {
// need to save related object because we set the relation to null
$orderRelatedByAddressInvoice->save($con);
}
$this->ordersRelatedByAddressInvoiceScheduledForDeletion = null;
if ($this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion !== null) {
if (!$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->isEmpty()) {
\Thelia\Model\OrderQuery::create()
->filterByPrimaryKeys($this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = null;
}
}
if ($this->collOrdersRelatedByAddressInvoice !== null) {
foreach ($this->collOrdersRelatedByAddressInvoice as $referrerFK) {
if ($this->collOrdersRelatedByInvoiceOrderAddressId !== null) {
foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->ordersRelatedByAddressDeliveryScheduledForDeletion !== null) {
if (!$this->ordersRelatedByAddressDeliveryScheduledForDeletion->isEmpty()) {
foreach ($this->ordersRelatedByAddressDeliveryScheduledForDeletion as $orderRelatedByAddressDelivery) {
// need to save related object because we set the relation to null
$orderRelatedByAddressDelivery->save($con);
}
$this->ordersRelatedByAddressDeliveryScheduledForDeletion = null;
if ($this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion !== null) {
if (!$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->isEmpty()) {
\Thelia\Model\OrderQuery::create()
->filterByPrimaryKeys($this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = null;
}
}
if ($this->collOrdersRelatedByAddressDelivery !== null) {
foreach ($this->collOrdersRelatedByAddressDelivery as $referrerFK) {
if ($this->collOrdersRelatedByDeliveryOrderAddressId !== null) {
foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1495,11 +1493,11 @@ abstract class OrderAddress implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->collOrdersRelatedByAddressInvoice) {
$result['OrdersRelatedByAddressInvoice'] = $this->collOrdersRelatedByAddressInvoice->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->collOrdersRelatedByInvoiceOrderAddressId) {
$result['OrdersRelatedByInvoiceOrderAddressId'] = $this->collOrdersRelatedByInvoiceOrderAddressId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collOrdersRelatedByAddressDelivery) {
$result['OrdersRelatedByAddressDelivery'] = $this->collOrdersRelatedByAddressDelivery->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->collOrdersRelatedByDeliveryOrderAddressId) {
$result['OrdersRelatedByDeliveryOrderAddressId'] = $this->collOrdersRelatedByDeliveryOrderAddressId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
@@ -1722,15 +1720,15 @@ abstract class OrderAddress implements ActiveRecordInterface
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
foreach ($this->getOrdersRelatedByAddressInvoice() as $relObj) {
foreach ($this->getOrdersRelatedByInvoiceOrderAddressId() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addOrderRelatedByAddressInvoice($relObj->copy($deepCopy));
$copyObj->addOrderRelatedByInvoiceOrderAddressId($relObj->copy($deepCopy));
}
}
foreach ($this->getOrdersRelatedByAddressDelivery() as $relObj) {
foreach ($this->getOrdersRelatedByDeliveryOrderAddressId() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addOrderRelatedByAddressDelivery($relObj->copy($deepCopy));
$copyObj->addOrderRelatedByDeliveryOrderAddressId($relObj->copy($deepCopy));
}
}
@@ -1775,40 +1773,40 @@ abstract class OrderAddress implements ActiveRecordInterface
*/
public function initRelation($relationName)
{
if ('OrderRelatedByAddressInvoice' == $relationName) {
return $this->initOrdersRelatedByAddressInvoice();
if ('OrderRelatedByInvoiceOrderAddressId' == $relationName) {
return $this->initOrdersRelatedByInvoiceOrderAddressId();
}
if ('OrderRelatedByAddressDelivery' == $relationName) {
return $this->initOrdersRelatedByAddressDelivery();
if ('OrderRelatedByDeliveryOrderAddressId' == $relationName) {
return $this->initOrdersRelatedByDeliveryOrderAddressId();
}
}
/**
* Clears out the collOrdersRelatedByAddressInvoice collection
* Clears out the collOrdersRelatedByInvoiceOrderAddressId collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addOrdersRelatedByAddressInvoice()
* @see addOrdersRelatedByInvoiceOrderAddressId()
*/
public function clearOrdersRelatedByAddressInvoice()
public function clearOrdersRelatedByInvoiceOrderAddressId()
{
$this->collOrdersRelatedByAddressInvoice = null; // important to set this to NULL since that means it is uninitialized
$this->collOrdersRelatedByInvoiceOrderAddressId = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collOrdersRelatedByAddressInvoice collection loaded partially.
* Reset is the collOrdersRelatedByInvoiceOrderAddressId collection loaded partially.
*/
public function resetPartialOrdersRelatedByAddressInvoice($v = true)
public function resetPartialOrdersRelatedByInvoiceOrderAddressId($v = true)
{
$this->collOrdersRelatedByAddressInvoicePartial = $v;
$this->collOrdersRelatedByInvoiceOrderAddressIdPartial = $v;
}
/**
* Initializes the collOrdersRelatedByAddressInvoice collection.
* Initializes the collOrdersRelatedByInvoiceOrderAddressId collection.
*
* By default this just sets the collOrdersRelatedByAddressInvoice collection to an empty array (like clearcollOrdersRelatedByAddressInvoice());
* By default this just sets the collOrdersRelatedByInvoiceOrderAddressId collection to an empty array (like clearcollOrdersRelatedByInvoiceOrderAddressId());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
@@ -1817,13 +1815,13 @@ abstract class OrderAddress implements ActiveRecordInterface
*
* @return void
*/
public function initOrdersRelatedByAddressInvoice($overrideExisting = true)
public function initOrdersRelatedByInvoiceOrderAddressId($overrideExisting = true)
{
if (null !== $this->collOrdersRelatedByAddressInvoice && !$overrideExisting) {
if (null !== $this->collOrdersRelatedByInvoiceOrderAddressId && !$overrideExisting) {
return;
}
$this->collOrdersRelatedByAddressInvoice = new ObjectCollection();
$this->collOrdersRelatedByAddressInvoice->setModel('\Thelia\Model\Order');
$this->collOrdersRelatedByInvoiceOrderAddressId = new ObjectCollection();
$this->collOrdersRelatedByInvoiceOrderAddressId->setModel('\Thelia\Model\Order');
}
/**
@@ -1840,80 +1838,80 @@ abstract class OrderAddress implements ActiveRecordInterface
* @return Collection|ChildOrder[] List of ChildOrder objects
* @throws PropelException
*/
public function getOrdersRelatedByAddressInvoice($criteria = null, ConnectionInterface $con = null)
public function getOrdersRelatedByInvoiceOrderAddressId($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collOrdersRelatedByAddressInvoicePartial && !$this->isNew();
if (null === $this->collOrdersRelatedByAddressInvoice || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByAddressInvoice) {
$partial = $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByInvoiceOrderAddressId || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByInvoiceOrderAddressId) {
// return empty collection
$this->initOrdersRelatedByAddressInvoice();
$this->initOrdersRelatedByInvoiceOrderAddressId();
} else {
$collOrdersRelatedByAddressInvoice = ChildOrderQuery::create(null, $criteria)
->filterByOrderAddressRelatedByAddressInvoice($this)
$collOrdersRelatedByInvoiceOrderAddressId = ChildOrderQuery::create(null, $criteria)
->filterByOrderAddressRelatedByInvoiceOrderAddressId($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collOrdersRelatedByAddressInvoicePartial && count($collOrdersRelatedByAddressInvoice)) {
$this->initOrdersRelatedByAddressInvoice(false);
if (false !== $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && count($collOrdersRelatedByInvoiceOrderAddressId)) {
$this->initOrdersRelatedByInvoiceOrderAddressId(false);
foreach ($collOrdersRelatedByAddressInvoice as $obj) {
if (false == $this->collOrdersRelatedByAddressInvoice->contains($obj)) {
$this->collOrdersRelatedByAddressInvoice->append($obj);
foreach ($collOrdersRelatedByInvoiceOrderAddressId as $obj) {
if (false == $this->collOrdersRelatedByInvoiceOrderAddressId->contains($obj)) {
$this->collOrdersRelatedByInvoiceOrderAddressId->append($obj);
}
}
$this->collOrdersRelatedByAddressInvoicePartial = true;
$this->collOrdersRelatedByInvoiceOrderAddressIdPartial = true;
}
$collOrdersRelatedByAddressInvoice->getInternalIterator()->rewind();
$collOrdersRelatedByInvoiceOrderAddressId->getInternalIterator()->rewind();
return $collOrdersRelatedByAddressInvoice;
return $collOrdersRelatedByInvoiceOrderAddressId;
}
if ($partial && $this->collOrdersRelatedByAddressInvoice) {
foreach ($this->collOrdersRelatedByAddressInvoice as $obj) {
if ($partial && $this->collOrdersRelatedByInvoiceOrderAddressId) {
foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $obj) {
if ($obj->isNew()) {
$collOrdersRelatedByAddressInvoice[] = $obj;
$collOrdersRelatedByInvoiceOrderAddressId[] = $obj;
}
}
}
$this->collOrdersRelatedByAddressInvoice = $collOrdersRelatedByAddressInvoice;
$this->collOrdersRelatedByAddressInvoicePartial = false;
$this->collOrdersRelatedByInvoiceOrderAddressId = $collOrdersRelatedByInvoiceOrderAddressId;
$this->collOrdersRelatedByInvoiceOrderAddressIdPartial = false;
}
}
return $this->collOrdersRelatedByAddressInvoice;
return $this->collOrdersRelatedByInvoiceOrderAddressId;
}
/**
* Sets a collection of OrderRelatedByAddressInvoice objects related by a one-to-many relationship
* Sets a collection of OrderRelatedByInvoiceOrderAddressId objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param Collection $ordersRelatedByAddressInvoice A Propel collection.
* @param Collection $ordersRelatedByInvoiceOrderAddressId A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildOrderAddress The current object (for fluent API support)
*/
public function setOrdersRelatedByAddressInvoice(Collection $ordersRelatedByAddressInvoice, ConnectionInterface $con = null)
public function setOrdersRelatedByInvoiceOrderAddressId(Collection $ordersRelatedByInvoiceOrderAddressId, ConnectionInterface $con = null)
{
$ordersRelatedByAddressInvoiceToDelete = $this->getOrdersRelatedByAddressInvoice(new Criteria(), $con)->diff($ordersRelatedByAddressInvoice);
$ordersRelatedByInvoiceOrderAddressIdToDelete = $this->getOrdersRelatedByInvoiceOrderAddressId(new Criteria(), $con)->diff($ordersRelatedByInvoiceOrderAddressId);
$this->ordersRelatedByAddressInvoiceScheduledForDeletion = $ordersRelatedByAddressInvoiceToDelete;
$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = $ordersRelatedByInvoiceOrderAddressIdToDelete;
foreach ($ordersRelatedByAddressInvoiceToDelete as $orderRelatedByAddressInvoiceRemoved) {
$orderRelatedByAddressInvoiceRemoved->setOrderAddressRelatedByAddressInvoice(null);
foreach ($ordersRelatedByInvoiceOrderAddressIdToDelete as $orderRelatedByInvoiceOrderAddressIdRemoved) {
$orderRelatedByInvoiceOrderAddressIdRemoved->setOrderAddressRelatedByInvoiceOrderAddressId(null);
}
$this->collOrdersRelatedByAddressInvoice = null;
foreach ($ordersRelatedByAddressInvoice as $orderRelatedByAddressInvoice) {
$this->addOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice);
$this->collOrdersRelatedByInvoiceOrderAddressId = null;
foreach ($ordersRelatedByInvoiceOrderAddressId as $orderRelatedByInvoiceOrderAddressId) {
$this->addOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId);
}
$this->collOrdersRelatedByAddressInvoice = $ordersRelatedByAddressInvoice;
$this->collOrdersRelatedByAddressInvoicePartial = false;
$this->collOrdersRelatedByInvoiceOrderAddressId = $ordersRelatedByInvoiceOrderAddressId;
$this->collOrdersRelatedByInvoiceOrderAddressIdPartial = false;
return $this;
}
@@ -1927,16 +1925,16 @@ abstract class OrderAddress implements ActiveRecordInterface
* @return int Count of related Order objects.
* @throws PropelException
*/
public function countOrdersRelatedByAddressInvoice(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countOrdersRelatedByInvoiceOrderAddressId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collOrdersRelatedByAddressInvoicePartial && !$this->isNew();
if (null === $this->collOrdersRelatedByAddressInvoice || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByAddressInvoice) {
$partial = $this->collOrdersRelatedByInvoiceOrderAddressIdPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByInvoiceOrderAddressId || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByInvoiceOrderAddressId) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getOrdersRelatedByAddressInvoice());
return count($this->getOrdersRelatedByInvoiceOrderAddressId());
}
$query = ChildOrderQuery::create(null, $criteria);
@@ -1945,11 +1943,11 @@ abstract class OrderAddress implements ActiveRecordInterface
}
return $query
->filterByOrderAddressRelatedByAddressInvoice($this)
->filterByOrderAddressRelatedByInvoiceOrderAddressId($this)
->count($con);
}
return count($this->collOrdersRelatedByAddressInvoice);
return count($this->collOrdersRelatedByInvoiceOrderAddressId);
}
/**
@@ -1959,43 +1957,43 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param ChildOrder $l ChildOrder
* @return \Thelia\Model\OrderAddress The current object (for fluent API support)
*/
public function addOrderRelatedByAddressInvoice(ChildOrder $l)
public function addOrderRelatedByInvoiceOrderAddressId(ChildOrder $l)
{
if ($this->collOrdersRelatedByAddressInvoice === null) {
$this->initOrdersRelatedByAddressInvoice();
$this->collOrdersRelatedByAddressInvoicePartial = true;
if ($this->collOrdersRelatedByInvoiceOrderAddressId === null) {
$this->initOrdersRelatedByInvoiceOrderAddressId();
$this->collOrdersRelatedByInvoiceOrderAddressIdPartial = true;
}
if (!in_array($l, $this->collOrdersRelatedByAddressInvoice->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddOrderRelatedByAddressInvoice($l);
if (!in_array($l, $this->collOrdersRelatedByInvoiceOrderAddressId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddOrderRelatedByInvoiceOrderAddressId($l);
}
return $this;
}
/**
* @param OrderRelatedByAddressInvoice $orderRelatedByAddressInvoice The orderRelatedByAddressInvoice object to add.
* @param OrderRelatedByInvoiceOrderAddressId $orderRelatedByInvoiceOrderAddressId The orderRelatedByInvoiceOrderAddressId object to add.
*/
protected function doAddOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice)
protected function doAddOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId)
{
$this->collOrdersRelatedByAddressInvoice[]= $orderRelatedByAddressInvoice;
$orderRelatedByAddressInvoice->setOrderAddressRelatedByAddressInvoice($this);
$this->collOrdersRelatedByInvoiceOrderAddressId[]= $orderRelatedByInvoiceOrderAddressId;
$orderRelatedByInvoiceOrderAddressId->setOrderAddressRelatedByInvoiceOrderAddressId($this);
}
/**
* @param OrderRelatedByAddressInvoice $orderRelatedByAddressInvoice The orderRelatedByAddressInvoice object to remove.
* @param OrderRelatedByInvoiceOrderAddressId $orderRelatedByInvoiceOrderAddressId The orderRelatedByInvoiceOrderAddressId object to remove.
* @return ChildOrderAddress The current object (for fluent API support)
*/
public function removeOrderRelatedByAddressInvoice($orderRelatedByAddressInvoice)
public function removeOrderRelatedByInvoiceOrderAddressId($orderRelatedByInvoiceOrderAddressId)
{
if ($this->getOrdersRelatedByAddressInvoice()->contains($orderRelatedByAddressInvoice)) {
$this->collOrdersRelatedByAddressInvoice->remove($this->collOrdersRelatedByAddressInvoice->search($orderRelatedByAddressInvoice));
if (null === $this->ordersRelatedByAddressInvoiceScheduledForDeletion) {
$this->ordersRelatedByAddressInvoiceScheduledForDeletion = clone $this->collOrdersRelatedByAddressInvoice;
$this->ordersRelatedByAddressInvoiceScheduledForDeletion->clear();
if ($this->getOrdersRelatedByInvoiceOrderAddressId()->contains($orderRelatedByInvoiceOrderAddressId)) {
$this->collOrdersRelatedByInvoiceOrderAddressId->remove($this->collOrdersRelatedByInvoiceOrderAddressId->search($orderRelatedByInvoiceOrderAddressId));
if (null === $this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion) {
$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion = clone $this->collOrdersRelatedByInvoiceOrderAddressId;
$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion->clear();
}
$this->ordersRelatedByAddressInvoiceScheduledForDeletion[]= $orderRelatedByAddressInvoice;
$orderRelatedByAddressInvoice->setOrderAddressRelatedByAddressInvoice(null);
$this->ordersRelatedByInvoiceOrderAddressIdScheduledForDeletion[]= clone $orderRelatedByInvoiceOrderAddressId;
$orderRelatedByInvoiceOrderAddressId->setOrderAddressRelatedByInvoiceOrderAddressId(null);
}
return $this;
@@ -2007,7 +2005,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage.
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2018,12 +2016,12 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressInvoiceJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByInvoiceOrderAddressIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Currency', $joinBehavior);
return $this->getOrdersRelatedByAddressInvoice($query, $con);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
@@ -2032,7 +2030,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage.
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2043,12 +2041,12 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressInvoiceJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByInvoiceOrderAddressIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Customer', $joinBehavior);
return $this->getOrdersRelatedByAddressInvoice($query, $con);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
@@ -2057,7 +2055,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressInvoice from storage.
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2068,40 +2066,115 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressInvoiceJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByInvoiceOrderAddressIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderStatus', $joinBehavior);
return $this->getOrdersRelatedByAddressInvoice($query, $con);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByInvoiceOrderAddressIdJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByInvoiceOrderAddressIdJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByInvoiceOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByInvoiceOrderAddressIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Lang', $joinBehavior);
return $this->getOrdersRelatedByInvoiceOrderAddressId($query, $con);
}
/**
* Clears out the collOrdersRelatedByAddressDelivery collection
* Clears out the collOrdersRelatedByDeliveryOrderAddressId collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addOrdersRelatedByAddressDelivery()
* @see addOrdersRelatedByDeliveryOrderAddressId()
*/
public function clearOrdersRelatedByAddressDelivery()
public function clearOrdersRelatedByDeliveryOrderAddressId()
{
$this->collOrdersRelatedByAddressDelivery = null; // important to set this to NULL since that means it is uninitialized
$this->collOrdersRelatedByDeliveryOrderAddressId = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collOrdersRelatedByAddressDelivery collection loaded partially.
* Reset is the collOrdersRelatedByDeliveryOrderAddressId collection loaded partially.
*/
public function resetPartialOrdersRelatedByAddressDelivery($v = true)
public function resetPartialOrdersRelatedByDeliveryOrderAddressId($v = true)
{
$this->collOrdersRelatedByAddressDeliveryPartial = $v;
$this->collOrdersRelatedByDeliveryOrderAddressIdPartial = $v;
}
/**
* Initializes the collOrdersRelatedByAddressDelivery collection.
* Initializes the collOrdersRelatedByDeliveryOrderAddressId collection.
*
* By default this just sets the collOrdersRelatedByAddressDelivery collection to an empty array (like clearcollOrdersRelatedByAddressDelivery());
* By default this just sets the collOrdersRelatedByDeliveryOrderAddressId collection to an empty array (like clearcollOrdersRelatedByDeliveryOrderAddressId());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
@@ -2110,13 +2183,13 @@ abstract class OrderAddress implements ActiveRecordInterface
*
* @return void
*/
public function initOrdersRelatedByAddressDelivery($overrideExisting = true)
public function initOrdersRelatedByDeliveryOrderAddressId($overrideExisting = true)
{
if (null !== $this->collOrdersRelatedByAddressDelivery && !$overrideExisting) {
if (null !== $this->collOrdersRelatedByDeliveryOrderAddressId && !$overrideExisting) {
return;
}
$this->collOrdersRelatedByAddressDelivery = new ObjectCollection();
$this->collOrdersRelatedByAddressDelivery->setModel('\Thelia\Model\Order');
$this->collOrdersRelatedByDeliveryOrderAddressId = new ObjectCollection();
$this->collOrdersRelatedByDeliveryOrderAddressId->setModel('\Thelia\Model\Order');
}
/**
@@ -2133,80 +2206,80 @@ abstract class OrderAddress implements ActiveRecordInterface
* @return Collection|ChildOrder[] List of ChildOrder objects
* @throws PropelException
*/
public function getOrdersRelatedByAddressDelivery($criteria = null, ConnectionInterface $con = null)
public function getOrdersRelatedByDeliveryOrderAddressId($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collOrdersRelatedByAddressDeliveryPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByAddressDelivery || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByAddressDelivery) {
$partial = $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByDeliveryOrderAddressId || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryOrderAddressId) {
// return empty collection
$this->initOrdersRelatedByAddressDelivery();
$this->initOrdersRelatedByDeliveryOrderAddressId();
} else {
$collOrdersRelatedByAddressDelivery = ChildOrderQuery::create(null, $criteria)
->filterByOrderAddressRelatedByAddressDelivery($this)
$collOrdersRelatedByDeliveryOrderAddressId = ChildOrderQuery::create(null, $criteria)
->filterByOrderAddressRelatedByDeliveryOrderAddressId($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collOrdersRelatedByAddressDeliveryPartial && count($collOrdersRelatedByAddressDelivery)) {
$this->initOrdersRelatedByAddressDelivery(false);
if (false !== $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && count($collOrdersRelatedByDeliveryOrderAddressId)) {
$this->initOrdersRelatedByDeliveryOrderAddressId(false);
foreach ($collOrdersRelatedByAddressDelivery as $obj) {
if (false == $this->collOrdersRelatedByAddressDelivery->contains($obj)) {
$this->collOrdersRelatedByAddressDelivery->append($obj);
foreach ($collOrdersRelatedByDeliveryOrderAddressId as $obj) {
if (false == $this->collOrdersRelatedByDeliveryOrderAddressId->contains($obj)) {
$this->collOrdersRelatedByDeliveryOrderAddressId->append($obj);
}
}
$this->collOrdersRelatedByAddressDeliveryPartial = true;
$this->collOrdersRelatedByDeliveryOrderAddressIdPartial = true;
}
$collOrdersRelatedByAddressDelivery->getInternalIterator()->rewind();
$collOrdersRelatedByDeliveryOrderAddressId->getInternalIterator()->rewind();
return $collOrdersRelatedByAddressDelivery;
return $collOrdersRelatedByDeliveryOrderAddressId;
}
if ($partial && $this->collOrdersRelatedByAddressDelivery) {
foreach ($this->collOrdersRelatedByAddressDelivery as $obj) {
if ($partial && $this->collOrdersRelatedByDeliveryOrderAddressId) {
foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $obj) {
if ($obj->isNew()) {
$collOrdersRelatedByAddressDelivery[] = $obj;
$collOrdersRelatedByDeliveryOrderAddressId[] = $obj;
}
}
}
$this->collOrdersRelatedByAddressDelivery = $collOrdersRelatedByAddressDelivery;
$this->collOrdersRelatedByAddressDeliveryPartial = false;
$this->collOrdersRelatedByDeliveryOrderAddressId = $collOrdersRelatedByDeliveryOrderAddressId;
$this->collOrdersRelatedByDeliveryOrderAddressIdPartial = false;
}
}
return $this->collOrdersRelatedByAddressDelivery;
return $this->collOrdersRelatedByDeliveryOrderAddressId;
}
/**
* Sets a collection of OrderRelatedByAddressDelivery objects related by a one-to-many relationship
* Sets a collection of OrderRelatedByDeliveryOrderAddressId objects related by a one-to-many relationship
* to the current object.
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
* and new objects from the given Propel collection.
*
* @param Collection $ordersRelatedByAddressDelivery A Propel collection.
* @param Collection $ordersRelatedByDeliveryOrderAddressId A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildOrderAddress The current object (for fluent API support)
*/
public function setOrdersRelatedByAddressDelivery(Collection $ordersRelatedByAddressDelivery, ConnectionInterface $con = null)
public function setOrdersRelatedByDeliveryOrderAddressId(Collection $ordersRelatedByDeliveryOrderAddressId, ConnectionInterface $con = null)
{
$ordersRelatedByAddressDeliveryToDelete = $this->getOrdersRelatedByAddressDelivery(new Criteria(), $con)->diff($ordersRelatedByAddressDelivery);
$ordersRelatedByDeliveryOrderAddressIdToDelete = $this->getOrdersRelatedByDeliveryOrderAddressId(new Criteria(), $con)->diff($ordersRelatedByDeliveryOrderAddressId);
$this->ordersRelatedByAddressDeliveryScheduledForDeletion = $ordersRelatedByAddressDeliveryToDelete;
$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = $ordersRelatedByDeliveryOrderAddressIdToDelete;
foreach ($ordersRelatedByAddressDeliveryToDelete as $orderRelatedByAddressDeliveryRemoved) {
$orderRelatedByAddressDeliveryRemoved->setOrderAddressRelatedByAddressDelivery(null);
foreach ($ordersRelatedByDeliveryOrderAddressIdToDelete as $orderRelatedByDeliveryOrderAddressIdRemoved) {
$orderRelatedByDeliveryOrderAddressIdRemoved->setOrderAddressRelatedByDeliveryOrderAddressId(null);
}
$this->collOrdersRelatedByAddressDelivery = null;
foreach ($ordersRelatedByAddressDelivery as $orderRelatedByAddressDelivery) {
$this->addOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery);
$this->collOrdersRelatedByDeliveryOrderAddressId = null;
foreach ($ordersRelatedByDeliveryOrderAddressId as $orderRelatedByDeliveryOrderAddressId) {
$this->addOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId);
}
$this->collOrdersRelatedByAddressDelivery = $ordersRelatedByAddressDelivery;
$this->collOrdersRelatedByAddressDeliveryPartial = false;
$this->collOrdersRelatedByDeliveryOrderAddressId = $ordersRelatedByDeliveryOrderAddressId;
$this->collOrdersRelatedByDeliveryOrderAddressIdPartial = false;
return $this;
}
@@ -2220,16 +2293,16 @@ abstract class OrderAddress implements ActiveRecordInterface
* @return int Count of related Order objects.
* @throws PropelException
*/
public function countOrdersRelatedByAddressDelivery(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countOrdersRelatedByDeliveryOrderAddressId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collOrdersRelatedByAddressDeliveryPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByAddressDelivery || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByAddressDelivery) {
$partial = $this->collOrdersRelatedByDeliveryOrderAddressIdPartial && !$this->isNew();
if (null === $this->collOrdersRelatedByDeliveryOrderAddressId || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collOrdersRelatedByDeliveryOrderAddressId) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getOrdersRelatedByAddressDelivery());
return count($this->getOrdersRelatedByDeliveryOrderAddressId());
}
$query = ChildOrderQuery::create(null, $criteria);
@@ -2238,11 +2311,11 @@ abstract class OrderAddress implements ActiveRecordInterface
}
return $query
->filterByOrderAddressRelatedByAddressDelivery($this)
->filterByOrderAddressRelatedByDeliveryOrderAddressId($this)
->count($con);
}
return count($this->collOrdersRelatedByAddressDelivery);
return count($this->collOrdersRelatedByDeliveryOrderAddressId);
}
/**
@@ -2252,43 +2325,43 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param ChildOrder $l ChildOrder
* @return \Thelia\Model\OrderAddress The current object (for fluent API support)
*/
public function addOrderRelatedByAddressDelivery(ChildOrder $l)
public function addOrderRelatedByDeliveryOrderAddressId(ChildOrder $l)
{
if ($this->collOrdersRelatedByAddressDelivery === null) {
$this->initOrdersRelatedByAddressDelivery();
$this->collOrdersRelatedByAddressDeliveryPartial = true;
if ($this->collOrdersRelatedByDeliveryOrderAddressId === null) {
$this->initOrdersRelatedByDeliveryOrderAddressId();
$this->collOrdersRelatedByDeliveryOrderAddressIdPartial = true;
}
if (!in_array($l, $this->collOrdersRelatedByAddressDelivery->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddOrderRelatedByAddressDelivery($l);
if (!in_array($l, $this->collOrdersRelatedByDeliveryOrderAddressId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddOrderRelatedByDeliveryOrderAddressId($l);
}
return $this;
}
/**
* @param OrderRelatedByAddressDelivery $orderRelatedByAddressDelivery The orderRelatedByAddressDelivery object to add.
* @param OrderRelatedByDeliveryOrderAddressId $orderRelatedByDeliveryOrderAddressId The orderRelatedByDeliveryOrderAddressId object to add.
*/
protected function doAddOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery)
protected function doAddOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId)
{
$this->collOrdersRelatedByAddressDelivery[]= $orderRelatedByAddressDelivery;
$orderRelatedByAddressDelivery->setOrderAddressRelatedByAddressDelivery($this);
$this->collOrdersRelatedByDeliveryOrderAddressId[]= $orderRelatedByDeliveryOrderAddressId;
$orderRelatedByDeliveryOrderAddressId->setOrderAddressRelatedByDeliveryOrderAddressId($this);
}
/**
* @param OrderRelatedByAddressDelivery $orderRelatedByAddressDelivery The orderRelatedByAddressDelivery object to remove.
* @param OrderRelatedByDeliveryOrderAddressId $orderRelatedByDeliveryOrderAddressId The orderRelatedByDeliveryOrderAddressId object to remove.
* @return ChildOrderAddress The current object (for fluent API support)
*/
public function removeOrderRelatedByAddressDelivery($orderRelatedByAddressDelivery)
public function removeOrderRelatedByDeliveryOrderAddressId($orderRelatedByDeliveryOrderAddressId)
{
if ($this->getOrdersRelatedByAddressDelivery()->contains($orderRelatedByAddressDelivery)) {
$this->collOrdersRelatedByAddressDelivery->remove($this->collOrdersRelatedByAddressDelivery->search($orderRelatedByAddressDelivery));
if (null === $this->ordersRelatedByAddressDeliveryScheduledForDeletion) {
$this->ordersRelatedByAddressDeliveryScheduledForDeletion = clone $this->collOrdersRelatedByAddressDelivery;
$this->ordersRelatedByAddressDeliveryScheduledForDeletion->clear();
if ($this->getOrdersRelatedByDeliveryOrderAddressId()->contains($orderRelatedByDeliveryOrderAddressId)) {
$this->collOrdersRelatedByDeliveryOrderAddressId->remove($this->collOrdersRelatedByDeliveryOrderAddressId->search($orderRelatedByDeliveryOrderAddressId));
if (null === $this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion) {
$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion = clone $this->collOrdersRelatedByDeliveryOrderAddressId;
$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion->clear();
}
$this->ordersRelatedByAddressDeliveryScheduledForDeletion[]= $orderRelatedByAddressDelivery;
$orderRelatedByAddressDelivery->setOrderAddressRelatedByAddressDelivery(null);
$this->ordersRelatedByDeliveryOrderAddressIdScheduledForDeletion[]= clone $orderRelatedByDeliveryOrderAddressId;
$orderRelatedByDeliveryOrderAddressId->setOrderAddressRelatedByDeliveryOrderAddressId(null);
}
return $this;
@@ -2300,7 +2373,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage.
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2311,12 +2384,12 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressDeliveryJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByDeliveryOrderAddressIdJoinCurrency($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Currency', $joinBehavior);
return $this->getOrdersRelatedByAddressDelivery($query, $con);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
@@ -2325,7 +2398,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage.
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2336,12 +2409,12 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressDeliveryJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByDeliveryOrderAddressIdJoinCustomer($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Customer', $joinBehavior);
return $this->getOrdersRelatedByAddressDelivery($query, $con);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
@@ -2350,7 +2423,7 @@ abstract class OrderAddress implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByAddressDelivery from storage.
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2361,12 +2434,87 @@ abstract class OrderAddress implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByAddressDeliveryJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersRelatedByDeliveryOrderAddressIdJoinOrderStatus($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderStatus', $joinBehavior);
return $this->getOrdersRelatedByAddressDelivery($query, $con);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByDeliveryOrderAddressIdJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByDeliveryOrderAddressIdJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderAddress is new, it will return
* an empty collection; or if this OrderAddress has previously
* been saved, it will retrieve related OrdersRelatedByDeliveryOrderAddressId from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderAddress.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersRelatedByDeliveryOrderAddressIdJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Lang', $joinBehavior);
return $this->getOrdersRelatedByDeliveryOrderAddressId($query, $con);
}
/**
@@ -2407,26 +2555,26 @@ abstract class OrderAddress implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collOrdersRelatedByAddressInvoice) {
foreach ($this->collOrdersRelatedByAddressInvoice as $o) {
if ($this->collOrdersRelatedByInvoiceOrderAddressId) {
foreach ($this->collOrdersRelatedByInvoiceOrderAddressId as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collOrdersRelatedByAddressDelivery) {
foreach ($this->collOrdersRelatedByAddressDelivery as $o) {
if ($this->collOrdersRelatedByDeliveryOrderAddressId) {
foreach ($this->collOrdersRelatedByDeliveryOrderAddressId as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep)
if ($this->collOrdersRelatedByAddressInvoice instanceof Collection) {
$this->collOrdersRelatedByAddressInvoice->clearIterator();
if ($this->collOrdersRelatedByInvoiceOrderAddressId instanceof Collection) {
$this->collOrdersRelatedByInvoiceOrderAddressId->clearIterator();
}
$this->collOrdersRelatedByAddressInvoice = null;
if ($this->collOrdersRelatedByAddressDelivery instanceof Collection) {
$this->collOrdersRelatedByAddressDelivery->clearIterator();
$this->collOrdersRelatedByInvoiceOrderAddressId = null;
if ($this->collOrdersRelatedByDeliveryOrderAddressId instanceof Collection) {
$this->collOrdersRelatedByDeliveryOrderAddressId->clearIterator();
}
$this->collOrdersRelatedByAddressDelivery = null;
$this->collOrdersRelatedByDeliveryOrderAddressId = null;
}
/**

View File

@@ -55,13 +55,13 @@ use Thelia\Model\Map\OrderAddressTableMap;
* @method ChildOrderAddressQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildOrderAddressQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildOrderAddressQuery leftJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByAddressInvoice relation
* @method ChildOrderAddressQuery rightJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByAddressInvoice relation
* @method ChildOrderAddressQuery innerJoinOrderRelatedByAddressInvoice($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByAddressInvoice relation
* @method ChildOrderAddressQuery leftJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation
* @method ChildOrderAddressQuery rightJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation
* @method ChildOrderAddressQuery innerJoinOrderRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation
*
* @method ChildOrderAddressQuery leftJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByAddressDelivery relation
* @method ChildOrderAddressQuery rightJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByAddressDelivery relation
* @method ChildOrderAddressQuery innerJoinOrderRelatedByAddressDelivery($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByAddressDelivery relation
* @method ChildOrderAddressQuery leftJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation
* @method ChildOrderAddressQuery rightJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation
* @method ChildOrderAddressQuery innerJoinOrderRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation
*
* @method ChildOrderAddress findOne(ConnectionInterface $con = null) Return the first ChildOrderAddress matching the query
* @method ChildOrderAddress findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrderAddress matching the query, or a new ChildOrderAddress object populated from the query conditions when no match is found
@@ -750,33 +750,33 @@ abstract class OrderAddressQuery extends ModelCriteria
*
* @return ChildOrderAddressQuery The current query, for fluid interface
*/
public function filterByOrderRelatedByAddressInvoice($order, $comparison = null)
public function filterByOrderRelatedByInvoiceOrderAddressId($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(OrderAddressTableMap::ID, $order->getAddressInvoice(), $comparison);
->addUsingAlias(OrderAddressTableMap::ID, $order->getInvoiceOrderAddressId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderRelatedByAddressInvoiceQuery()
->useOrderRelatedByInvoiceOrderAddressIdQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrderRelatedByAddressInvoice() only accepts arguments of type \Thelia\Model\Order or Collection');
throw new PropelException('filterByOrderRelatedByInvoiceOrderAddressId() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderRelatedByAddressInvoice relation
* Adds a JOIN clause to the query using the OrderRelatedByInvoiceOrderAddressId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderAddressQuery The current query, for fluid interface
*/
public function joinOrderRelatedByAddressInvoice($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrderRelatedByInvoiceOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderRelatedByAddressInvoice');
$relationMap = $tableMap->getRelation('OrderRelatedByInvoiceOrderAddressId');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -791,14 +791,14 @@ abstract class OrderAddressQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'OrderRelatedByAddressInvoice');
$this->addJoinObject($join, 'OrderRelatedByInvoiceOrderAddressId');
}
return $this;
}
/**
* Use the OrderRelatedByAddressInvoice relation Order object
* Use the OrderRelatedByInvoiceOrderAddressId relation Order object
*
* @see useQuery()
*
@@ -808,11 +808,11 @@ abstract class OrderAddressQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderRelatedByAddressInvoiceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderRelatedByInvoiceOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderRelatedByAddressInvoice($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByAddressInvoice', '\Thelia\Model\OrderQuery');
->joinOrderRelatedByInvoiceOrderAddressId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByInvoiceOrderAddressId', '\Thelia\Model\OrderQuery');
}
/**
@@ -823,33 +823,33 @@ abstract class OrderAddressQuery extends ModelCriteria
*
* @return ChildOrderAddressQuery The current query, for fluid interface
*/
public function filterByOrderRelatedByAddressDelivery($order, $comparison = null)
public function filterByOrderRelatedByDeliveryOrderAddressId($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(OrderAddressTableMap::ID, $order->getAddressDelivery(), $comparison);
->addUsingAlias(OrderAddressTableMap::ID, $order->getDeliveryOrderAddressId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
return $this
->useOrderRelatedByAddressDeliveryQuery()
->useOrderRelatedByDeliveryOrderAddressIdQuery()
->filterByPrimaryKeys($order->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByOrderRelatedByAddressDelivery() only accepts arguments of type \Thelia\Model\Order or Collection');
throw new PropelException('filterByOrderRelatedByDeliveryOrderAddressId() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderRelatedByAddressDelivery relation
* Adds a JOIN clause to the query using the OrderRelatedByDeliveryOrderAddressId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderAddressQuery The current query, for fluid interface
*/
public function joinOrderRelatedByAddressDelivery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrderRelatedByDeliveryOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderRelatedByAddressDelivery');
$relationMap = $tableMap->getRelation('OrderRelatedByDeliveryOrderAddressId');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -864,14 +864,14 @@ abstract class OrderAddressQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'OrderRelatedByAddressDelivery');
$this->addJoinObject($join, 'OrderRelatedByDeliveryOrderAddressId');
}
return $this;
}
/**
* Use the OrderRelatedByAddressDelivery relation Order object
* Use the OrderRelatedByDeliveryOrderAddressId relation Order object
*
* @see useQuery()
*
@@ -881,11 +881,11 @@ abstract class OrderAddressQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderRelatedByAddressDeliveryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderRelatedByDeliveryOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderRelatedByAddressDelivery($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByAddressDelivery', '\Thelia\Model\OrderQuery');
->joinOrderRelatedByDeliveryOrderAddressId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderRelatedByDeliveryOrderAddressId', '\Thelia\Model\OrderQuery');
}
/**

View File

@@ -24,38 +24,38 @@ use Thelia\Model\Map\OrderTableMap;
* @method ChildOrderQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildOrderQuery orderByRef($order = Criteria::ASC) Order by the ref column
* @method ChildOrderQuery orderByCustomerId($order = Criteria::ASC) Order by the customer_id column
* @method ChildOrderQuery orderByAddressInvoice($order = Criteria::ASC) Order by the address_invoice column
* @method ChildOrderQuery orderByAddressDelivery($order = Criteria::ASC) Order by the address_delivery column
* @method ChildOrderQuery orderByInvoiceOrderAddressId($order = Criteria::ASC) Order by the invoice_order_address_id column
* @method ChildOrderQuery orderByDeliveryOrderAddressId($order = Criteria::ASC) Order by the delivery_order_address_id column
* @method ChildOrderQuery orderByInvoiceDate($order = Criteria::ASC) Order by the invoice_date column
* @method ChildOrderQuery orderByCurrencyId($order = Criteria::ASC) Order by the currency_id column
* @method ChildOrderQuery orderByCurrencyRate($order = Criteria::ASC) Order by the currency_rate column
* @method ChildOrderQuery orderByTransaction($order = Criteria::ASC) Order by the transaction column
* @method ChildOrderQuery orderByDeliveryNum($order = Criteria::ASC) Order by the delivery_num column
* @method ChildOrderQuery orderByInvoice($order = Criteria::ASC) Order by the invoice column
* @method ChildOrderQuery orderByTransactionRef($order = Criteria::ASC) Order by the transaction_ref column
* @method ChildOrderQuery orderByDeliveryRef($order = Criteria::ASC) Order by the delivery_ref column
* @method ChildOrderQuery orderByInvoiceRef($order = Criteria::ASC) Order by the invoice_ref column
* @method ChildOrderQuery orderByPostage($order = Criteria::ASC) Order by the postage column
* @method ChildOrderQuery orderByPayment($order = Criteria::ASC) Order by the payment column
* @method ChildOrderQuery orderByCarrier($order = Criteria::ASC) Order by the carrier column
* @method ChildOrderQuery orderByPaymentModuleId($order = Criteria::ASC) Order by the payment_module_id column
* @method ChildOrderQuery orderByDeliveryModuleId($order = Criteria::ASC) Order by the delivery_module_id column
* @method ChildOrderQuery orderByStatusId($order = Criteria::ASC) Order by the status_id column
* @method ChildOrderQuery orderByLang($order = Criteria::ASC) Order by the lang column
* @method ChildOrderQuery orderByLangId($order = Criteria::ASC) Order by the lang_id column
* @method ChildOrderQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildOrderQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildOrderQuery groupById() Group by the id column
* @method ChildOrderQuery groupByRef() Group by the ref column
* @method ChildOrderQuery groupByCustomerId() Group by the customer_id column
* @method ChildOrderQuery groupByAddressInvoice() Group by the address_invoice column
* @method ChildOrderQuery groupByAddressDelivery() Group by the address_delivery column
* @method ChildOrderQuery groupByInvoiceOrderAddressId() Group by the invoice_order_address_id column
* @method ChildOrderQuery groupByDeliveryOrderAddressId() Group by the delivery_order_address_id column
* @method ChildOrderQuery groupByInvoiceDate() Group by the invoice_date column
* @method ChildOrderQuery groupByCurrencyId() Group by the currency_id column
* @method ChildOrderQuery groupByCurrencyRate() Group by the currency_rate column
* @method ChildOrderQuery groupByTransaction() Group by the transaction column
* @method ChildOrderQuery groupByDeliveryNum() Group by the delivery_num column
* @method ChildOrderQuery groupByInvoice() Group by the invoice column
* @method ChildOrderQuery groupByTransactionRef() Group by the transaction_ref column
* @method ChildOrderQuery groupByDeliveryRef() Group by the delivery_ref column
* @method ChildOrderQuery groupByInvoiceRef() Group by the invoice_ref column
* @method ChildOrderQuery groupByPostage() Group by the postage column
* @method ChildOrderQuery groupByPayment() Group by the payment column
* @method ChildOrderQuery groupByCarrier() Group by the carrier column
* @method ChildOrderQuery groupByPaymentModuleId() Group by the payment_module_id column
* @method ChildOrderQuery groupByDeliveryModuleId() Group by the delivery_module_id column
* @method ChildOrderQuery groupByStatusId() Group by the status_id column
* @method ChildOrderQuery groupByLang() Group by the lang column
* @method ChildOrderQuery groupByLangId() Group by the lang_id column
* @method ChildOrderQuery groupByCreatedAt() Group by the created_at column
* @method ChildOrderQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -71,18 +71,30 @@ use Thelia\Model\Map\OrderTableMap;
* @method ChildOrderQuery rightJoinCustomer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Customer relation
* @method ChildOrderQuery innerJoinCustomer($relationAlias = null) Adds a INNER JOIN clause to the query using the Customer relation
*
* @method ChildOrderQuery leftJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation
* @method ChildOrderQuery rightJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation
* @method ChildOrderQuery innerJoinOrderAddressRelatedByAddressInvoice($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation
* @method ChildOrderQuery leftJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation
* @method ChildOrderQuery rightJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation
* @method ChildOrderQuery innerJoinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation
*
* @method ChildOrderQuery leftJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation
* @method ChildOrderQuery rightJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation
* @method ChildOrderQuery innerJoinOrderAddressRelatedByAddressDelivery($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation
* @method ChildOrderQuery leftJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation
* @method ChildOrderQuery rightJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation
* @method ChildOrderQuery innerJoinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation
*
* @method ChildOrderQuery leftJoinOrderStatus($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderStatus relation
* @method ChildOrderQuery rightJoinOrderStatus($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderStatus relation
* @method ChildOrderQuery innerJoinOrderStatus($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderStatus relation
*
* @method ChildOrderQuery leftJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation
* @method ChildOrderQuery rightJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation
* @method ChildOrderQuery innerJoinModuleRelatedByPaymentModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation
*
* @method ChildOrderQuery leftJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation
* @method ChildOrderQuery rightJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation
* @method ChildOrderQuery innerJoinModuleRelatedByDeliveryModuleId($relationAlias = null) Adds a INNER JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation
*
* @method ChildOrderQuery leftJoinLang($relationAlias = null) Adds a LEFT JOIN clause to the query using the Lang relation
* @method ChildOrderQuery rightJoinLang($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Lang relation
* @method ChildOrderQuery innerJoinLang($relationAlias = null) Adds a INNER JOIN clause to the query using the Lang relation
*
* @method ChildOrderQuery leftJoinOrderProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderProduct relation
* @method ChildOrderQuery rightJoinOrderProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProduct relation
* @method ChildOrderQuery innerJoinOrderProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProduct relation
@@ -97,38 +109,38 @@ use Thelia\Model\Map\OrderTableMap;
* @method ChildOrder findOneById(int $id) Return the first ChildOrder filtered by the id column
* @method ChildOrder findOneByRef(string $ref) Return the first ChildOrder filtered by the ref column
* @method ChildOrder findOneByCustomerId(int $customer_id) Return the first ChildOrder filtered by the customer_id column
* @method ChildOrder findOneByAddressInvoice(int $address_invoice) Return the first ChildOrder filtered by the address_invoice column
* @method ChildOrder findOneByAddressDelivery(int $address_delivery) Return the first ChildOrder filtered by the address_delivery column
* @method ChildOrder findOneByInvoiceOrderAddressId(int $invoice_order_address_id) Return the first ChildOrder filtered by the invoice_order_address_id column
* @method ChildOrder findOneByDeliveryOrderAddressId(int $delivery_order_address_id) Return the first ChildOrder filtered by the delivery_order_address_id column
* @method ChildOrder findOneByInvoiceDate(string $invoice_date) Return the first ChildOrder filtered by the invoice_date column
* @method ChildOrder findOneByCurrencyId(int $currency_id) Return the first ChildOrder filtered by the currency_id column
* @method ChildOrder findOneByCurrencyRate(double $currency_rate) Return the first ChildOrder filtered by the currency_rate column
* @method ChildOrder findOneByTransaction(string $transaction) Return the first ChildOrder filtered by the transaction column
* @method ChildOrder findOneByDeliveryNum(string $delivery_num) Return the first ChildOrder filtered by the delivery_num column
* @method ChildOrder findOneByInvoice(string $invoice) Return the first ChildOrder filtered by the invoice column
* @method ChildOrder findOneByTransactionRef(string $transaction_ref) Return the first ChildOrder filtered by the transaction_ref column
* @method ChildOrder findOneByDeliveryRef(string $delivery_ref) Return the first ChildOrder filtered by the delivery_ref column
* @method ChildOrder findOneByInvoiceRef(string $invoice_ref) Return the first ChildOrder filtered by the invoice_ref column
* @method ChildOrder findOneByPostage(double $postage) Return the first ChildOrder filtered by the postage column
* @method ChildOrder findOneByPayment(string $payment) Return the first ChildOrder filtered by the payment column
* @method ChildOrder findOneByCarrier(string $carrier) Return the first ChildOrder filtered by the carrier column
* @method ChildOrder findOneByPaymentModuleId(int $payment_module_id) Return the first ChildOrder filtered by the payment_module_id column
* @method ChildOrder findOneByDeliveryModuleId(int $delivery_module_id) Return the first ChildOrder filtered by the delivery_module_id column
* @method ChildOrder findOneByStatusId(int $status_id) Return the first ChildOrder filtered by the status_id column
* @method ChildOrder findOneByLang(string $lang) Return the first ChildOrder filtered by the lang column
* @method ChildOrder findOneByLangId(int $lang_id) Return the first ChildOrder filtered by the lang_id column
* @method ChildOrder findOneByCreatedAt(string $created_at) Return the first ChildOrder filtered by the created_at column
* @method ChildOrder findOneByUpdatedAt(string $updated_at) Return the first ChildOrder filtered by the updated_at column
*
* @method array findById(int $id) Return ChildOrder objects filtered by the id column
* @method array findByRef(string $ref) Return ChildOrder objects filtered by the ref column
* @method array findByCustomerId(int $customer_id) Return ChildOrder objects filtered by the customer_id column
* @method array findByAddressInvoice(int $address_invoice) Return ChildOrder objects filtered by the address_invoice column
* @method array findByAddressDelivery(int $address_delivery) Return ChildOrder objects filtered by the address_delivery column
* @method array findByInvoiceOrderAddressId(int $invoice_order_address_id) Return ChildOrder objects filtered by the invoice_order_address_id column
* @method array findByDeliveryOrderAddressId(int $delivery_order_address_id) Return ChildOrder objects filtered by the delivery_order_address_id column
* @method array findByInvoiceDate(string $invoice_date) Return ChildOrder objects filtered by the invoice_date column
* @method array findByCurrencyId(int $currency_id) Return ChildOrder objects filtered by the currency_id column
* @method array findByCurrencyRate(double $currency_rate) Return ChildOrder objects filtered by the currency_rate column
* @method array findByTransaction(string $transaction) Return ChildOrder objects filtered by the transaction column
* @method array findByDeliveryNum(string $delivery_num) Return ChildOrder objects filtered by the delivery_num column
* @method array findByInvoice(string $invoice) Return ChildOrder objects filtered by the invoice column
* @method array findByTransactionRef(string $transaction_ref) Return ChildOrder objects filtered by the transaction_ref column
* @method array findByDeliveryRef(string $delivery_ref) Return ChildOrder objects filtered by the delivery_ref column
* @method array findByInvoiceRef(string $invoice_ref) Return ChildOrder objects filtered by the invoice_ref column
* @method array findByPostage(double $postage) Return ChildOrder objects filtered by the postage column
* @method array findByPayment(string $payment) Return ChildOrder objects filtered by the payment column
* @method array findByCarrier(string $carrier) Return ChildOrder objects filtered by the carrier column
* @method array findByPaymentModuleId(int $payment_module_id) Return ChildOrder objects filtered by the payment_module_id column
* @method array findByDeliveryModuleId(int $delivery_module_id) Return ChildOrder objects filtered by the delivery_module_id column
* @method array findByStatusId(int $status_id) Return ChildOrder objects filtered by the status_id column
* @method array findByLang(string $lang) Return ChildOrder objects filtered by the lang column
* @method array findByLangId(int $lang_id) Return ChildOrder objects filtered by the lang_id column
* @method array findByCreatedAt(string $created_at) Return ChildOrder objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildOrder objects filtered by the updated_at column
*
@@ -219,7 +231,7 @@ abstract class OrderQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, REF, CUSTOMER_ID, ADDRESS_INVOICE, ADDRESS_DELIVERY, INVOICE_DATE, CURRENCY_ID, CURRENCY_RATE, TRANSACTION, DELIVERY_NUM, INVOICE, POSTAGE, PAYMENT, CARRIER, STATUS_ID, LANG, CREATED_AT, UPDATED_AT FROM order WHERE ID = :p0';
$sql = 'SELECT ID, REF, CUSTOMER_ID, INVOICE_ORDER_ADDRESS_ID, DELIVERY_ORDER_ADDRESS_ID, INVOICE_DATE, CURRENCY_ID, CURRENCY_RATE, TRANSACTION_REF, DELIVERY_REF, INVOICE_REF, POSTAGE, PAYMENT_MODULE_ID, DELIVERY_MODULE_ID, STATUS_ID, LANG_ID, CREATED_AT, UPDATED_AT FROM order WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -422,18 +434,18 @@ abstract class OrderQuery extends ModelCriteria
}
/**
* Filter the query on the address_invoice column
* Filter the query on the invoice_order_address_id column
*
* Example usage:
* <code>
* $query->filterByAddressInvoice(1234); // WHERE address_invoice = 1234
* $query->filterByAddressInvoice(array(12, 34)); // WHERE address_invoice IN (12, 34)
* $query->filterByAddressInvoice(array('min' => 12)); // WHERE address_invoice > 12
* $query->filterByInvoiceOrderAddressId(1234); // WHERE invoice_order_address_id = 1234
* $query->filterByInvoiceOrderAddressId(array(12, 34)); // WHERE invoice_order_address_id IN (12, 34)
* $query->filterByInvoiceOrderAddressId(array('min' => 12)); // WHERE invoice_order_address_id > 12
* </code>
*
* @see filterByOrderAddressRelatedByAddressInvoice()
* @see filterByOrderAddressRelatedByInvoiceOrderAddressId()
*
* @param mixed $addressInvoice The value to use as filter.
* @param mixed $invoiceOrderAddressId 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.
@@ -441,16 +453,16 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByAddressInvoice($addressInvoice = null, $comparison = null)
public function filterByInvoiceOrderAddressId($invoiceOrderAddressId = null, $comparison = null)
{
if (is_array($addressInvoice)) {
if (is_array($invoiceOrderAddressId)) {
$useMinMax = false;
if (isset($addressInvoice['min'])) {
$this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice['min'], Criteria::GREATER_EQUAL);
if (isset($invoiceOrderAddressId['min'])) {
$this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($addressInvoice['max'])) {
$this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice['max'], Criteria::LESS_EQUAL);
if (isset($invoiceOrderAddressId['max'])) {
$this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -461,22 +473,22 @@ abstract class OrderQuery extends ModelCriteria
}
}
return $this->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $addressInvoice, $comparison);
return $this->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $invoiceOrderAddressId, $comparison);
}
/**
* Filter the query on the address_delivery column
* Filter the query on the delivery_order_address_id column
*
* Example usage:
* <code>
* $query->filterByAddressDelivery(1234); // WHERE address_delivery = 1234
* $query->filterByAddressDelivery(array(12, 34)); // WHERE address_delivery IN (12, 34)
* $query->filterByAddressDelivery(array('min' => 12)); // WHERE address_delivery > 12
* $query->filterByDeliveryOrderAddressId(1234); // WHERE delivery_order_address_id = 1234
* $query->filterByDeliveryOrderAddressId(array(12, 34)); // WHERE delivery_order_address_id IN (12, 34)
* $query->filterByDeliveryOrderAddressId(array('min' => 12)); // WHERE delivery_order_address_id > 12
* </code>
*
* @see filterByOrderAddressRelatedByAddressDelivery()
* @see filterByOrderAddressRelatedByDeliveryOrderAddressId()
*
* @param mixed $addressDelivery The value to use as filter.
* @param mixed $deliveryOrderAddressId 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.
@@ -484,16 +496,16 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByAddressDelivery($addressDelivery = null, $comparison = null)
public function filterByDeliveryOrderAddressId($deliveryOrderAddressId = null, $comparison = null)
{
if (is_array($addressDelivery)) {
if (is_array($deliveryOrderAddressId)) {
$useMinMax = false;
if (isset($addressDelivery['min'])) {
$this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery['min'], Criteria::GREATER_EQUAL);
if (isset($deliveryOrderAddressId['min'])) {
$this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($addressDelivery['max'])) {
$this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery['max'], Criteria::LESS_EQUAL);
if (isset($deliveryOrderAddressId['max'])) {
$this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -504,7 +516,7 @@ abstract class OrderQuery extends ModelCriteria
}
}
return $this->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $addressDelivery, $comparison);
return $this->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $deliveryOrderAddressId, $comparison);
}
/**
@@ -635,90 +647,90 @@ abstract class OrderQuery extends ModelCriteria
}
/**
* Filter the query on the transaction column
* Filter the query on the transaction_ref column
*
* Example usage:
* <code>
* $query->filterByTransaction('fooValue'); // WHERE transaction = 'fooValue'
* $query->filterByTransaction('%fooValue%'); // WHERE transaction LIKE '%fooValue%'
* $query->filterByTransactionRef('fooValue'); // WHERE transaction_ref = 'fooValue'
* $query->filterByTransactionRef('%fooValue%'); // WHERE transaction_ref LIKE '%fooValue%'
* </code>
*
* @param string $transaction The value to use as filter.
* @param string $transactionRef 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByTransaction($transaction = null, $comparison = null)
public function filterByTransactionRef($transactionRef = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($transaction)) {
if (is_array($transactionRef)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $transaction)) {
$transaction = str_replace('*', '%', $transaction);
} elseif (preg_match('/[\%\*]/', $transactionRef)) {
$transactionRef = str_replace('*', '%', $transactionRef);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::TRANSACTION, $transaction, $comparison);
return $this->addUsingAlias(OrderTableMap::TRANSACTION_REF, $transactionRef, $comparison);
}
/**
* Filter the query on the delivery_num column
* Filter the query on the delivery_ref column
*
* Example usage:
* <code>
* $query->filterByDeliveryNum('fooValue'); // WHERE delivery_num = 'fooValue'
* $query->filterByDeliveryNum('%fooValue%'); // WHERE delivery_num LIKE '%fooValue%'
* $query->filterByDeliveryRef('fooValue'); // WHERE delivery_ref = 'fooValue'
* $query->filterByDeliveryRef('%fooValue%'); // WHERE delivery_ref LIKE '%fooValue%'
* </code>
*
* @param string $deliveryNum The value to use as filter.
* @param string $deliveryRef 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByDeliveryNum($deliveryNum = null, $comparison = null)
public function filterByDeliveryRef($deliveryRef = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($deliveryNum)) {
if (is_array($deliveryRef)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $deliveryNum)) {
$deliveryNum = str_replace('*', '%', $deliveryNum);
} elseif (preg_match('/[\%\*]/', $deliveryRef)) {
$deliveryRef = str_replace('*', '%', $deliveryRef);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::DELIVERY_NUM, $deliveryNum, $comparison);
return $this->addUsingAlias(OrderTableMap::DELIVERY_REF, $deliveryRef, $comparison);
}
/**
* Filter the query on the invoice column
* Filter the query on the invoice_ref column
*
* Example usage:
* <code>
* $query->filterByInvoice('fooValue'); // WHERE invoice = 'fooValue'
* $query->filterByInvoice('%fooValue%'); // WHERE invoice LIKE '%fooValue%'
* $query->filterByInvoiceRef('fooValue'); // WHERE invoice_ref = 'fooValue'
* $query->filterByInvoiceRef('%fooValue%'); // WHERE invoice_ref LIKE '%fooValue%'
* </code>
*
* @param string $invoice The value to use as filter.
* @param string $invoiceRef 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByInvoice($invoice = null, $comparison = null)
public function filterByInvoiceRef($invoiceRef = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($invoice)) {
if (is_array($invoiceRef)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $invoice)) {
$invoice = str_replace('*', '%', $invoice);
} elseif (preg_match('/[\%\*]/', $invoiceRef)) {
$invoiceRef = str_replace('*', '%', $invoiceRef);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::INVOICE, $invoice, $comparison);
return $this->addUsingAlias(OrderTableMap::INVOICE_REF, $invoiceRef, $comparison);
}
/**
@@ -763,61 +775,89 @@ abstract class OrderQuery extends ModelCriteria
}
/**
* Filter the query on the payment column
* Filter the query on the payment_module_id column
*
* Example usage:
* <code>
* $query->filterByPayment('fooValue'); // WHERE payment = 'fooValue'
* $query->filterByPayment('%fooValue%'); // WHERE payment LIKE '%fooValue%'
* $query->filterByPaymentModuleId(1234); // WHERE payment_module_id = 1234
* $query->filterByPaymentModuleId(array(12, 34)); // WHERE payment_module_id IN (12, 34)
* $query->filterByPaymentModuleId(array('min' => 12)); // WHERE payment_module_id > 12
* </code>
*
* @param string $payment The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @see filterByModuleRelatedByPaymentModuleId()
*
* @param mixed $paymentModuleId 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByPayment($payment = null, $comparison = null)
public function filterByPaymentModuleId($paymentModuleId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($payment)) {
if (is_array($paymentModuleId)) {
$useMinMax = false;
if (isset($paymentModuleId['min'])) {
$this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($paymentModuleId['max'])) {
$this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $payment)) {
$payment = str_replace('*', '%', $payment);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::PAYMENT, $payment, $comparison);
return $this->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $paymentModuleId, $comparison);
}
/**
* Filter the query on the carrier column
* Filter the query on the delivery_module_id column
*
* Example usage:
* <code>
* $query->filterByCarrier('fooValue'); // WHERE carrier = 'fooValue'
* $query->filterByCarrier('%fooValue%'); // WHERE carrier LIKE '%fooValue%'
* $query->filterByDeliveryModuleId(1234); // WHERE delivery_module_id = 1234
* $query->filterByDeliveryModuleId(array(12, 34)); // WHERE delivery_module_id IN (12, 34)
* $query->filterByDeliveryModuleId(array('min' => 12)); // WHERE delivery_module_id > 12
* </code>
*
* @param string $carrier The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @see filterByModuleRelatedByDeliveryModuleId()
*
* @param mixed $deliveryModuleId 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByCarrier($carrier = null, $comparison = null)
public function filterByDeliveryModuleId($deliveryModuleId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($carrier)) {
if (is_array($deliveryModuleId)) {
$useMinMax = false;
if (isset($deliveryModuleId['min'])) {
$this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModuleId['max'])) {
$this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $carrier)) {
$carrier = str_replace('*', '%', $carrier);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::CARRIER, $carrier, $comparison);
return $this->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $deliveryModuleId, $comparison);
}
/**
@@ -864,32 +904,46 @@ abstract class OrderQuery extends ModelCriteria
}
/**
* Filter the query on the lang column
* Filter the query on the lang_id column
*
* Example usage:
* <code>
* $query->filterByLang('fooValue'); // WHERE lang = 'fooValue'
* $query->filterByLang('%fooValue%'); // WHERE lang LIKE '%fooValue%'
* $query->filterByLangId(1234); // WHERE lang_id = 1234
* $query->filterByLangId(array(12, 34)); // WHERE lang_id IN (12, 34)
* $query->filterByLangId(array('min' => 12)); // WHERE lang_id > 12
* </code>
*
* @param string $lang The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @see filterByLang()
*
* @param mixed $langId 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 ChildOrderQuery The current query, for fluid interface
*/
public function filterByLang($lang = null, $comparison = null)
public function filterByLangId($langId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lang)) {
if (is_array($langId)) {
$useMinMax = false;
if (isset($langId['min'])) {
$this->addUsingAlias(OrderTableMap::LANG_ID, $langId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($langId['max'])) {
$this->addUsingAlias(OrderTableMap::LANG_ID, $langId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lang)) {
$lang = str_replace('*', '%', $lang);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderTableMap::LANG, $lang, $comparison);
return $this->addUsingAlias(OrderTableMap::LANG_ID, $langId, $comparison);
}
/**
@@ -1011,7 +1065,7 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinCurrency($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinCurrency($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Currency');
@@ -1046,7 +1100,7 @@ abstract class OrderQuery extends ModelCriteria
*
* @return \Thelia\Model\CurrencyQuery A secondary query class using the current class as primary query
*/
public function useCurrencyQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useCurrencyQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCurrency($relationAlias, $joinType)
@@ -1136,35 +1190,35 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByOrderAddressRelatedByAddressInvoice($orderAddress, $comparison = null)
public function filterByOrderAddressRelatedByInvoiceOrderAddressId($orderAddress, $comparison = null)
{
if ($orderAddress instanceof \Thelia\Model\OrderAddress) {
return $this
->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $orderAddress->getId(), $comparison);
->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $orderAddress->getId(), $comparison);
} elseif ($orderAddress instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderTableMap::ADDRESS_INVOICE, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(OrderTableMap::INVOICE_ORDER_ADDRESS_ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByOrderAddressRelatedByAddressInvoice() only accepts arguments of type \Thelia\Model\OrderAddress or Collection');
throw new PropelException('filterByOrderAddressRelatedByInvoiceOrderAddressId() only accepts arguments of type \Thelia\Model\OrderAddress or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderAddressRelatedByAddressInvoice relation
* Adds a JOIN clause to the query using the OrderAddressRelatedByInvoiceOrderAddressId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinOrderAddressRelatedByAddressInvoice($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderAddressRelatedByAddressInvoice');
$relationMap = $tableMap->getRelation('OrderAddressRelatedByInvoiceOrderAddressId');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -1179,14 +1233,14 @@ abstract class OrderQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'OrderAddressRelatedByAddressInvoice');
$this->addJoinObject($join, 'OrderAddressRelatedByInvoiceOrderAddressId');
}
return $this;
}
/**
* Use the OrderAddressRelatedByAddressInvoice relation OrderAddress object
* Use the OrderAddressRelatedByInvoiceOrderAddressId relation OrderAddress object
*
* @see useQuery()
*
@@ -1196,11 +1250,11 @@ abstract class OrderQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query
*/
public function useOrderAddressRelatedByAddressInvoiceQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderAddressRelatedByInvoiceOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderAddressRelatedByAddressInvoice($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByAddressInvoice', '\Thelia\Model\OrderAddressQuery');
->joinOrderAddressRelatedByInvoiceOrderAddressId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByInvoiceOrderAddressId', '\Thelia\Model\OrderAddressQuery');
}
/**
@@ -1211,35 +1265,35 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByOrderAddressRelatedByAddressDelivery($orderAddress, $comparison = null)
public function filterByOrderAddressRelatedByDeliveryOrderAddressId($orderAddress, $comparison = null)
{
if ($orderAddress instanceof \Thelia\Model\OrderAddress) {
return $this
->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $orderAddress->getId(), $comparison);
->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $orderAddress->getId(), $comparison);
} elseif ($orderAddress instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderTableMap::ADDRESS_DELIVERY, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByOrderAddressRelatedByAddressDelivery() only accepts arguments of type \Thelia\Model\OrderAddress or Collection');
throw new PropelException('filterByOrderAddressRelatedByDeliveryOrderAddressId() only accepts arguments of type \Thelia\Model\OrderAddress or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderAddressRelatedByAddressDelivery relation
* Adds a JOIN clause to the query using the OrderAddressRelatedByDeliveryOrderAddressId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinOrderAddressRelatedByAddressDelivery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderAddressRelatedByAddressDelivery');
$relationMap = $tableMap->getRelation('OrderAddressRelatedByDeliveryOrderAddressId');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -1254,14 +1308,14 @@ abstract class OrderQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'OrderAddressRelatedByAddressDelivery');
$this->addJoinObject($join, 'OrderAddressRelatedByDeliveryOrderAddressId');
}
return $this;
}
/**
* Use the OrderAddressRelatedByAddressDelivery relation OrderAddress object
* Use the OrderAddressRelatedByDeliveryOrderAddressId relation OrderAddress object
*
* @see useQuery()
*
@@ -1271,11 +1325,11 @@ abstract class OrderQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query
*/
public function useOrderAddressRelatedByAddressDeliveryQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderAddressRelatedByDeliveryOrderAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderAddressRelatedByAddressDelivery($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByAddressDelivery', '\Thelia\Model\OrderAddressQuery');
->joinOrderAddressRelatedByDeliveryOrderAddressId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderAddressRelatedByDeliveryOrderAddressId', '\Thelia\Model\OrderAddressQuery');
}
/**
@@ -1311,7 +1365,7 @@ abstract class OrderQuery extends ModelCriteria
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinOrderStatus($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrderStatus($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderStatus');
@@ -1346,13 +1400,238 @@ abstract class OrderQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderStatusQuery A secondary query class using the current class as primary query
*/
public function useOrderStatusQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderStatusQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderStatus($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderStatus', '\Thelia\Model\OrderStatusQuery');
}
/**
* Filter the query by a related \Thelia\Model\Module object
*
* @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByModuleRelatedByPaymentModuleId($module, $comparison = null)
{
if ($module instanceof \Thelia\Model\Module) {
return $this
->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $module->getId(), $comparison);
} elseif ($module instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderTableMap::PAYMENT_MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByModuleRelatedByPaymentModuleId() only accepts arguments of type \Thelia\Model\Module or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ModuleRelatedByPaymentModuleId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinModuleRelatedByPaymentModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ModuleRelatedByPaymentModuleId');
// 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, 'ModuleRelatedByPaymentModuleId');
}
return $this;
}
/**
* Use the ModuleRelatedByPaymentModuleId relation Module 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\ModuleQuery A secondary query class using the current class as primary query
*/
public function useModuleRelatedByPaymentModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinModuleRelatedByPaymentModuleId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ModuleRelatedByPaymentModuleId', '\Thelia\Model\ModuleQuery');
}
/**
* Filter the query by a related \Thelia\Model\Module object
*
* @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByModuleRelatedByDeliveryModuleId($module, $comparison = null)
{
if ($module instanceof \Thelia\Model\Module) {
return $this
->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $module->getId(), $comparison);
} elseif ($module instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderTableMap::DELIVERY_MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByModuleRelatedByDeliveryModuleId() only accepts arguments of type \Thelia\Model\Module or Collection');
}
}
/**
* Adds a JOIN clause to the query using the ModuleRelatedByDeliveryModuleId relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinModuleRelatedByDeliveryModuleId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('ModuleRelatedByDeliveryModuleId');
// 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, 'ModuleRelatedByDeliveryModuleId');
}
return $this;
}
/**
* Use the ModuleRelatedByDeliveryModuleId relation Module 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\ModuleQuery A secondary query class using the current class as primary query
*/
public function useModuleRelatedByDeliveryModuleIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinModuleRelatedByDeliveryModuleId($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ModuleRelatedByDeliveryModuleId', '\Thelia\Model\ModuleQuery');
}
/**
* Filter the query by a related \Thelia\Model\Lang object
*
* @param \Thelia\Model\Lang|ObjectCollection $lang The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function filterByLang($lang, $comparison = null)
{
if ($lang instanceof \Thelia\Model\Lang) {
return $this
->addUsingAlias(OrderTableMap::LANG_ID, $lang->getId(), $comparison);
} elseif ($lang instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderTableMap::LANG_ID, $lang->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByLang() only accepts arguments of type \Thelia\Model\Lang or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Lang relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderQuery The current query, for fluid interface
*/
public function joinLang($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Lang');
// 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, 'Lang');
}
return $this;
}
/**
* Use the Lang relation Lang 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\LangQuery A secondary query class using the current class as primary query
*/
public function useLangQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinLang($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Lang', '\Thelia\Model\LangQuery');
}
/**
* Filter the query by a related \Thelia\Model\OrderProduct object
*

View File

@@ -791,10 +791,9 @@ abstract class OrderStatus implements ActiveRecordInterface
if ($this->ordersScheduledForDeletion !== null) {
if (!$this->ordersScheduledForDeletion->isEmpty()) {
foreach ($this->ordersScheduledForDeletion as $order) {
// need to save related object because we set the relation to null
$order->save($con);
}
\Thelia\Model\OrderQuery::create()
->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->ordersScheduledForDeletion = null;
}
}
@@ -1439,7 +1438,7 @@ abstract class OrderStatus implements ActiveRecordInterface
$this->ordersScheduledForDeletion = clone $this->collOrders;
$this->ordersScheduledForDeletion->clear();
}
$this->ordersScheduledForDeletion[]= $order;
$this->ordersScheduledForDeletion[]= clone $order;
$order->setOrderStatus(null);
}
@@ -1513,10 +1512,10 @@ abstract class OrderStatus implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressInvoice($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByInvoiceOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressInvoice', $joinBehavior);
$query->joinWith('OrderAddressRelatedByInvoiceOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
@@ -1538,10 +1537,85 @@ abstract class OrderStatus implements ActiveRecordInterface
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinOrderAddressRelatedByAddressDelivery($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getOrdersJoinOrderAddressRelatedByDeliveryOrderAddressId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('OrderAddressRelatedByAddressDelivery', $joinBehavior);
$query->joinWith('OrderAddressRelatedByDeliveryOrderAddressId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderStatus is new, it will return
* an empty collection; or if this OrderStatus has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderStatus.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByPaymentModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByPaymentModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderStatus is new, it will return
* an empty collection; or if this OrderStatus has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderStatus.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinModuleRelatedByDeliveryModuleId($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('ModuleRelatedByDeliveryModuleId', $joinBehavior);
return $this->getOrders($query, $con);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this OrderStatus is new, it will return
* an empty collection; or if this OrderStatus has previously
* been saved, it will retrieve related Orders from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in OrderStatus.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildOrder[] List of ChildOrder objects
*/
public function getOrdersJoinLang($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildOrderQuery::create(null, $criteria);
$query->joinWith('Lang', $joinBehavior);
return $this->getOrders($query, $con);
}

View File

@@ -420,7 +420,7 @@ abstract class OrderStatusQuery extends ModelCriteria
*
* @return ChildOrderStatusQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
@@ -455,7 +455,7 @@ abstract class OrderStatusQuery extends ModelCriteria
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)

View File

@@ -70,6 +70,12 @@ abstract class ProductCategory implements ActiveRecordInterface
*/
protected $category_id;
/**
* The value for the default_category field.
* @var boolean
*/
protected $default_category;
/**
* The value for the created_at field.
* @var string
@@ -376,6 +382,17 @@ abstract class ProductCategory implements ActiveRecordInterface
return $this->category_id;
}
/**
* Get the [default_category] column value.
*
* @return boolean
*/
public function getDefaultCategory()
{
return $this->default_category;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -466,6 +483,35 @@ abstract class ProductCategory implements ActiveRecordInterface
return $this;
} // setCategoryId()
/**
* Sets the value of the [default_category] column.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
*
* @param boolean|integer|string $v The new value
* @return \Thelia\Model\ProductCategory The current object (for fluent API support)
*/
public function setDefaultCategory($v)
{
if ($v !== null) {
if (is_string($v)) {
$v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
} else {
$v = (boolean) $v;
}
}
if ($this->default_category !== $v) {
$this->default_category = $v;
$this->modifiedColumns[] = ProductCategoryTableMap::DEFAULT_CATEGORY;
}
return $this;
} // setDefaultCategory()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -551,13 +597,16 @@ abstract class ProductCategory implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProductCategoryTableMap::translateFieldName('CategoryId', TableMap::TYPE_PHPNAME, $indexType)];
$this->category_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProductCategoryTableMap::translateFieldName('DefaultCategory', TableMap::TYPE_PHPNAME, $indexType)];
$this->default_category = (null !== $col) ? (boolean) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductCategoryTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProductCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProductCategoryTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -570,7 +619,7 @@ abstract class ProductCategory implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 4; // 4 = ProductCategoryTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 5; // 5 = ProductCategoryTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ProductCategory object", 0, $e);
@@ -819,6 +868,9 @@ abstract class ProductCategory implements ActiveRecordInterface
if ($this->isColumnModified(ProductCategoryTableMap::CATEGORY_ID)) {
$modifiedColumns[':p' . $index++] = 'CATEGORY_ID';
}
if ($this->isColumnModified(ProductCategoryTableMap::DEFAULT_CATEGORY)) {
$modifiedColumns[':p' . $index++] = 'DEFAULT_CATEGORY';
}
if ($this->isColumnModified(ProductCategoryTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -842,6 +894,9 @@ abstract class ProductCategory implements ActiveRecordInterface
case 'CATEGORY_ID':
$stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT);
break;
case 'DEFAULT_CATEGORY':
$stmt->bindValue($identifier, (int) $this->default_category, PDO::PARAM_INT);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break;
@@ -910,9 +965,12 @@ abstract class ProductCategory implements ActiveRecordInterface
return $this->getCategoryId();
break;
case 2:
return $this->getCreatedAt();
return $this->getDefaultCategory();
break;
case 3:
return $this->getCreatedAt();
break;
case 4:
return $this->getUpdatedAt();
break;
default:
@@ -946,8 +1004,9 @@ abstract class ProductCategory implements ActiveRecordInterface
$result = array(
$keys[0] => $this->getProductId(),
$keys[1] => $this->getCategoryId(),
$keys[2] => $this->getCreatedAt(),
$keys[3] => $this->getUpdatedAt(),
$keys[2] => $this->getDefaultCategory(),
$keys[3] => $this->getCreatedAt(),
$keys[4] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach($virtualColumns as $key => $virtualColumn)
@@ -1003,9 +1062,12 @@ abstract class ProductCategory implements ActiveRecordInterface
$this->setCategoryId($value);
break;
case 2:
$this->setCreatedAt($value);
$this->setDefaultCategory($value);
break;
case 3:
$this->setCreatedAt($value);
break;
case 4:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1034,8 +1096,9 @@ abstract class ProductCategory implements ActiveRecordInterface
if (array_key_exists($keys[0], $arr)) $this->setProductId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCategoryId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setCreatedAt($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setUpdatedAt($arr[$keys[3]]);
if (array_key_exists($keys[2], $arr)) $this->setDefaultCategory($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]);
}
/**
@@ -1049,6 +1112,7 @@ abstract class ProductCategory implements ActiveRecordInterface
if ($this->isColumnModified(ProductCategoryTableMap::PRODUCT_ID)) $criteria->add(ProductCategoryTableMap::PRODUCT_ID, $this->product_id);
if ($this->isColumnModified(ProductCategoryTableMap::CATEGORY_ID)) $criteria->add(ProductCategoryTableMap::CATEGORY_ID, $this->category_id);
if ($this->isColumnModified(ProductCategoryTableMap::DEFAULT_CATEGORY)) $criteria->add(ProductCategoryTableMap::DEFAULT_CATEGORY, $this->default_category);
if ($this->isColumnModified(ProductCategoryTableMap::CREATED_AT)) $criteria->add(ProductCategoryTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProductCategoryTableMap::UPDATED_AT)) $criteria->add(ProductCategoryTableMap::UPDATED_AT, $this->updated_at);
@@ -1123,6 +1187,7 @@ abstract class ProductCategory implements ActiveRecordInterface
{
$copyObj->setProductId($this->getProductId());
$copyObj->setCategoryId($this->getCategoryId());
$copyObj->setDefaultCategory($this->getDefaultCategory());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
@@ -1261,6 +1326,7 @@ abstract class ProductCategory implements ActiveRecordInterface
{
$this->product_id = null;
$this->category_id = null;
$this->default_category = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -23,11 +23,13 @@ use Thelia\Model\Map\ProductCategoryTableMap;
*
* @method ChildProductCategoryQuery orderByProductId($order = Criteria::ASC) Order by the product_id column
* @method ChildProductCategoryQuery orderByCategoryId($order = Criteria::ASC) Order by the category_id column
* @method ChildProductCategoryQuery orderByDefaultCategory($order = Criteria::ASC) Order by the default_category column
* @method ChildProductCategoryQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProductCategoryQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildProductCategoryQuery groupByProductId() Group by the product_id column
* @method ChildProductCategoryQuery groupByCategoryId() Group by the category_id column
* @method ChildProductCategoryQuery groupByDefaultCategory() Group by the default_category column
* @method ChildProductCategoryQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductCategoryQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -48,11 +50,13 @@ use Thelia\Model\Map\ProductCategoryTableMap;
*
* @method ChildProductCategory findOneByProductId(int $product_id) Return the first ChildProductCategory filtered by the product_id column
* @method ChildProductCategory findOneByCategoryId(int $category_id) Return the first ChildProductCategory filtered by the category_id column
* @method ChildProductCategory findOneByDefaultCategory(boolean $default_category) Return the first ChildProductCategory filtered by the default_category column
* @method ChildProductCategory findOneByCreatedAt(string $created_at) Return the first ChildProductCategory filtered by the created_at column
* @method ChildProductCategory findOneByUpdatedAt(string $updated_at) Return the first ChildProductCategory filtered by the updated_at column
*
* @method array findByProductId(int $product_id) Return ChildProductCategory objects filtered by the product_id column
* @method array findByCategoryId(int $category_id) Return ChildProductCategory objects filtered by the category_id column
* @method array findByDefaultCategory(boolean $default_category) Return ChildProductCategory objects filtered by the default_category column
* @method array findByCreatedAt(string $created_at) Return ChildProductCategory objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProductCategory objects filtered by the updated_at column
*
@@ -143,7 +147,7 @@ abstract class ProductCategoryQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT PRODUCT_ID, CATEGORY_ID, CREATED_AT, UPDATED_AT FROM product_category WHERE PRODUCT_ID = :p0 AND CATEGORY_ID = :p1';
$sql = 'SELECT PRODUCT_ID, CATEGORY_ID, DEFAULT_CATEGORY, CREATED_AT, UPDATED_AT FROM product_category WHERE PRODUCT_ID = :p0 AND CATEGORY_ID = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -330,6 +334,33 @@ abstract class ProductCategoryQuery extends ModelCriteria
return $this->addUsingAlias(ProductCategoryTableMap::CATEGORY_ID, $categoryId, $comparison);
}
/**
* Filter the query on the default_category column
*
* Example usage:
* <code>
* $query->filterByDefaultCategory(true); // WHERE default_category = true
* $query->filterByDefaultCategory('yes'); // WHERE default_category = true
* </code>
*
* @param boolean|string $defaultCategory The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildProductCategoryQuery The current query, for fluid interface
*/
public function filterByDefaultCategory($defaultCategory = null, $comparison = null)
{
if (is_string($defaultCategory)) {
$default_category = in_array(strtolower($defaultCategory), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ProductCategoryTableMap::DEFAULT_CATEGORY, $defaultCategory, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -8,6 +8,7 @@ use Thelia\Model\Base\Cart as BaseCart;
use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Model\ProductPriceQuery;
use Thelia\Model\CartItemQuery;
use Thelia\TaxEngine\Calculator;
class Cart extends BaseCart
{
@@ -74,9 +75,25 @@ class Cart extends BaseCart
;
}
public function getTaxedAmount()
public function getTaxedAmount(Country $country)
{
$taxCalculator = new Calculator();
$total = 0;
foreach($this->getCartItems() as $cartItem) {
$subtotal = $cartItem->getRealPrice();
$subtotal -= $cartItem->getDiscount();
/* we round it for the unit price, before the quantity factor */
$subtotal = round($taxCalculator->load($cartItem->getProduct(), $country)->getTaxedPrice($subtotal), 2);
$subtotal *= $cartItem->getQuantity();
$total += $subtotal;
}
$total -= $this->getDiscount();
return $total;
}
public function getTotalAmount()
@@ -84,7 +101,11 @@ class Cart extends BaseCart
$total = 0;
foreach($this->getCartItems() as $cartItem) {
$total += $cartItem->getPrice()-$cartItem->getDiscount();
$subtotal = $cartItem->getRealPrice();
$subtotal -= $cartItem->getDiscount();
$subtotal *= $cartItem->getQuantity();
$total += $subtotal;
}
$total -= $this->getDiscount();

View File

@@ -8,6 +8,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Base\CartItem as BaseCartItem;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Event\CartEvent;
use Thelia\TaxEngine\Calculator;
class CartItem extends BaseCartItem
{
@@ -64,4 +65,20 @@ class CartItem extends BaseCartItem
return $this;
}
public function getRealPrice()
{
return $this->getPromo() == 1 ? $this->getPromoPrice() : $this->getPrice();
}
public function getTaxedPrice(Country $country)
{
$taxCalculator = new Calculator();
return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPrice()), 2);
}
public function getTaxedPromoPrice(Country $country)
{
$taxCalculator = new Calculator();
return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPromoPrice()), 2);
}
}

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\Delivzone as BaseDelivzone;
class Delivzone extends BaseDelivzone {
}

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\Delivzone;
use Thelia\Model\DelivzoneQuery;
use Thelia\Model\AreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery;
/**
* This class defines the structure of the 'delivzone' table.
* This class defines the structure of the 'area_delivery_module' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\DelivzoneQuery;
* (i.e. if it's a text column type).
*
*/
class DelivzoneTableMap extends TableMap
class AreaDeliveryModuleTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.DelivzoneTableMap';
const CLASS_NAME = 'Thelia.Model.Map.AreaDeliveryModuleTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class DelivzoneTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'delivzone';
const TABLE_NAME = 'area_delivery_module';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\Delivzone';
const OM_CLASS = '\\Thelia\\Model\\AreaDeliveryModule';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.Delivzone';
const CLASS_DEFAULT = 'Thelia.Model.AreaDeliveryModule';
/**
* The total number of columns
@@ -72,27 +72,27 @@ class DelivzoneTableMap extends TableMap
/**
* the column name for the ID field
*/
const ID = 'delivzone.ID';
const ID = 'area_delivery_module.ID';
/**
* the column name for the AREA_ID field
*/
const AREA_ID = 'delivzone.AREA_ID';
const AREA_ID = 'area_delivery_module.AREA_ID';
/**
* the column name for the DELIVERY field
* the column name for the DELIVERY_MODULE_ID field
*/
const DELIVERY = 'delivzone.DELIVERY';
const DELIVERY_MODULE_ID = 'area_delivery_module.DELIVERY_MODULE_ID';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'delivzone.CREATED_AT';
const CREATED_AT = 'area_delivery_module.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'delivzone.UPDATED_AT';
const UPDATED_AT = 'area_delivery_module.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -106,11 +106,11 @@ class DelivzoneTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'AreaId', 'Delivery', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'delivery', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(DelivzoneTableMap::ID, DelivzoneTableMap::AREA_ID, DelivzoneTableMap::DELIVERY, DelivzoneTableMap::CREATED_AT, DelivzoneTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'AreaId', 'DeliveryModuleId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModuleId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AreaDeliveryModuleTableMap::ID, AreaDeliveryModuleTableMap::AREA_ID, AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID, AreaDeliveryModuleTableMap::CREATED_AT, AreaDeliveryModuleTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODULE_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_module_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -121,11 +121,11 @@ class DelivzoneTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'Delivery' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'delivery' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(DelivzoneTableMap::ID => 0, DelivzoneTableMap::AREA_ID => 1, DelivzoneTableMap::DELIVERY => 2, DelivzoneTableMap::CREATED_AT => 3, DelivzoneTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModuleId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModuleId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AreaDeliveryModuleTableMap::ID => 0, AreaDeliveryModuleTableMap::AREA_ID => 1, AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID => 2, AreaDeliveryModuleTableMap::CREATED_AT => 3, AreaDeliveryModuleTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODULE_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_module_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -139,15 +139,15 @@ class DelivzoneTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('delivzone');
$this->setPhpName('Delivzone');
$this->setClassName('\\Thelia\\Model\\Delivzone');
$this->setName('area_delivery_module');
$this->setPhpName('AreaDeliveryModule');
$this->setClassName('\\Thelia\\Model\\AreaDeliveryModule');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', false, null, null);
$this->addColumn('DELIVERY', 'Delivery', 'VARCHAR', true, 45, null);
$this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
$this->addForeignKey('DELIVERY_MODULE_ID', 'DeliveryModuleId', 'INTEGER', 'module', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -157,7 +157,8 @@ class DelivzoneTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Area', '\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('Area', '\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Module', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('delivery_module_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
@@ -229,7 +230,7 @@ class DelivzoneTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? DelivzoneTableMap::CLASS_DEFAULT : DelivzoneTableMap::OM_CLASS;
return $withPrefix ? AreaDeliveryModuleTableMap::CLASS_DEFAULT : AreaDeliveryModuleTableMap::OM_CLASS;
}
/**
@@ -243,21 +244,21 @@ class DelivzoneTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Delivzone object, last column rank)
* @return array (AreaDeliveryModule object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = DelivzoneTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = DelivzoneTableMap::getInstanceFromPool($key))) {
$key = AreaDeliveryModuleTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = AreaDeliveryModuleTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + DelivzoneTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + AreaDeliveryModuleTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = DelivzoneTableMap::OM_CLASS;
$cls = AreaDeliveryModuleTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
DelivzoneTableMap::addInstanceToPool($obj, $key);
AreaDeliveryModuleTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -280,8 +281,8 @@ class DelivzoneTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = DelivzoneTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = DelivzoneTableMap::getInstanceFromPool($key))) {
$key = AreaDeliveryModuleTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = AreaDeliveryModuleTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, 0, true); // rehydrate
@@ -290,7 +291,7 @@ class DelivzoneTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
DelivzoneTableMap::addInstanceToPool($obj, $key);
AreaDeliveryModuleTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -311,15 +312,15 @@ class DelivzoneTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(DelivzoneTableMap::ID);
$criteria->addSelectColumn(DelivzoneTableMap::AREA_ID);
$criteria->addSelectColumn(DelivzoneTableMap::DELIVERY);
$criteria->addSelectColumn(DelivzoneTableMap::CREATED_AT);
$criteria->addSelectColumn(DelivzoneTableMap::UPDATED_AT);
$criteria->addSelectColumn(AreaDeliveryModuleTableMap::ID);
$criteria->addSelectColumn(AreaDeliveryModuleTableMap::AREA_ID);
$criteria->addSelectColumn(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID);
$criteria->addSelectColumn(AreaDeliveryModuleTableMap::CREATED_AT);
$criteria->addSelectColumn(AreaDeliveryModuleTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.AREA_ID');
$criteria->addSelectColumn($alias . '.DELIVERY');
$criteria->addSelectColumn($alias . '.DELIVERY_MODULE_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -334,7 +335,7 @@ class DelivzoneTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(DelivzoneTableMap::DATABASE_NAME)->getTable(DelivzoneTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(AreaDeliveryModuleTableMap::DATABASE_NAME)->getTable(AreaDeliveryModuleTableMap::TABLE_NAME);
}
/**
@@ -342,16 +343,16 @@ class DelivzoneTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(DelivzoneTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(DelivzoneTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new DelivzoneTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(AreaDeliveryModuleTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(AreaDeliveryModuleTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new AreaDeliveryModuleTableMap());
}
}
/**
* Performs a DELETE on the database, given a Delivzone or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a AreaDeliveryModule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Delivzone object or primary key or array of primary keys
* @param mixed $values Criteria or AreaDeliveryModule 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
@@ -362,25 +363,25 @@ class DelivzoneTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\Delivzone) { // it's a model object
} elseif ($values instanceof \Thelia\Model\AreaDeliveryModule) { // it's a model object
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
$criteria = new Criteria(DelivzoneTableMap::DATABASE_NAME);
$criteria->add(DelivzoneTableMap::ID, (array) $values, Criteria::IN);
$criteria = new Criteria(AreaDeliveryModuleTableMap::DATABASE_NAME);
$criteria->add(AreaDeliveryModuleTableMap::ID, (array) $values, Criteria::IN);
}
$query = DelivzoneQuery::create()->mergeWith($criteria);
$query = AreaDeliveryModuleQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { DelivzoneTableMap::clearInstancePool();
if ($values instanceof Criteria) { AreaDeliveryModuleTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { DelivzoneTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { AreaDeliveryModuleTableMap::removeInstanceFromPool($singleval);
}
}
@@ -388,20 +389,20 @@ class DelivzoneTableMap extends TableMap
}
/**
* Deletes all rows from the delivzone table.
* Deletes all rows from the area_delivery_module table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return DelivzoneQuery::create()->doDeleteAll($con);
return AreaDeliveryModuleQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a Delivzone or Criteria object.
* Performs an INSERT on the database, given a AreaDeliveryModule or Criteria object.
*
* @param mixed $criteria Criteria or Delivzone object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or AreaDeliveryModule object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -410,22 +411,22 @@ class DelivzoneTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(DelivzoneTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(AreaDeliveryModuleTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from Delivzone object
$criteria = $criteria->buildCriteria(); // build Criteria from AreaDeliveryModule object
}
if ($criteria->containsKey(DelivzoneTableMap::ID) && $criteria->keyContainsValue(DelivzoneTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.DelivzoneTableMap::ID.')');
if ($criteria->containsKey(AreaDeliveryModuleTableMap::ID) && $criteria->keyContainsValue(AreaDeliveryModuleTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.AreaDeliveryModuleTableMap::ID.')');
}
// Set the correct dbName
$query = DelivzoneQuery::create()->mergeWith($criteria);
$query = AreaDeliveryModuleQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -441,7 +442,7 @@ class DelivzoneTableMap extends TableMap
return $pk;
}
} // DelivzoneTableMap
} // AreaDeliveryModuleTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
DelivzoneTableMap::buildTableMap();
AreaDeliveryModuleTableMap::buildTableMap();

View File

@@ -80,9 +80,9 @@ class AreaTableMap extends TableMap
const NAME = 'area.NAME';
/**
* the column name for the UNIT field
* the column name for the POSTAGE field
*/
const UNIT = 'area.UNIT';
const POSTAGE = 'area.POSTAGE';
/**
* the column name for the CREATED_AT field
@@ -106,11 +106,11 @@ class AreaTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Name', 'Unit', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'name', 'unit', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AreaTableMap::ID, AreaTableMap::NAME, AreaTableMap::UNIT, AreaTableMap::CREATED_AT, AreaTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'UNIT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'name', 'unit', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'Name', 'Postage', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'name', 'postage', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AreaTableMap::ID, AreaTableMap::NAME, AreaTableMap::POSTAGE, AreaTableMap::CREATED_AT, AreaTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'POSTAGE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'name', 'postage', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -121,11 +121,11 @@ class AreaTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Unit' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'unit' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AreaTableMap::ID => 0, AreaTableMap::NAME => 1, AreaTableMap::UNIT => 2, AreaTableMap::CREATED_AT => 3, AreaTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'UNIT' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'unit' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Postage' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'postage' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AreaTableMap::ID => 0, AreaTableMap::NAME => 1, AreaTableMap::POSTAGE => 2, AreaTableMap::CREATED_AT => 3, AreaTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'POSTAGE' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'postage' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -147,7 +147,7 @@ class AreaTableMap extends TableMap
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('NAME', 'Name', 'VARCHAR', true, 100, null);
$this->addColumn('UNIT', 'Unit', 'FLOAT', false, null, null);
$this->addColumn('POSTAGE', 'Postage', 'FLOAT', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -158,7 +158,7 @@ class AreaTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Country', '\\Thelia\\Model\\Country', RelationMap::ONE_TO_MANY, array('id' => 'area_id', ), 'SET NULL', 'RESTRICT', 'Countries');
$this->addRelation('Delivzone', '\\Thelia\\Model\\Delivzone', RelationMap::ONE_TO_MANY, array('id' => 'area_id', ), 'SET NULL', 'RESTRICT', 'Delivzones');
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'area_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
} // buildRelations()
/**
@@ -181,7 +181,7 @@ class AreaTableMap extends TableMap
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CountryTableMap::clearInstancePool();
DelivzoneTableMap::clearInstancePool();
AreaDeliveryModuleTableMap::clearInstancePool();
}
/**
@@ -324,13 +324,13 @@ class AreaTableMap extends TableMap
if (null === $alias) {
$criteria->addSelectColumn(AreaTableMap::ID);
$criteria->addSelectColumn(AreaTableMap::NAME);
$criteria->addSelectColumn(AreaTableMap::UNIT);
$criteria->addSelectColumn(AreaTableMap::POSTAGE);
$criteria->addSelectColumn(AreaTableMap::CREATED_AT);
$criteria->addSelectColumn(AreaTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.UNIT');
$criteria->addSelectColumn($alias . '.POSTAGE');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -57,7 +57,7 @@ class ContentFolderTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 5;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ContentFolderTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 4;
const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the CONTENT_ID field
@@ -79,6 +79,11 @@ class ContentFolderTableMap extends TableMap
*/
const FOLDER_ID = 'content_folder.FOLDER_ID';
/**
* the column name for the DEFAULT_FOLDER field
*/
const DEFAULT_FOLDER = 'content_folder.DEFAULT_FOLDER';
/**
* the column name for the CREATED_AT field
*/
@@ -101,12 +106,12 @@ class ContentFolderTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('ContentId', 'FolderId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('contentId', 'folderId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID, ContentFolderTableMap::FOLDER_ID, ContentFolderTableMap::CREATED_AT, ContentFolderTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('CONTENT_ID', 'FOLDER_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('content_id', 'folder_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('ContentId', 'FolderId', 'DefaultFolder', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('contentId', 'folderId', 'defaultFolder', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID, ContentFolderTableMap::FOLDER_ID, ContentFolderTableMap::DEFAULT_FOLDER, ContentFolderTableMap::CREATED_AT, ContentFolderTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('CONTENT_ID', 'FOLDER_ID', 'DEFAULT_FOLDER', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('content_id', 'folder_id', 'default_folder', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -116,12 +121,12 @@ class ContentFolderTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('ContentId' => 0, 'FolderId' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
self::TYPE_STUDLYPHPNAME => array('contentId' => 0, 'folderId' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID => 0, ContentFolderTableMap::FOLDER_ID => 1, ContentFolderTableMap::CREATED_AT => 2, ContentFolderTableMap::UPDATED_AT => 3, ),
self::TYPE_RAW_COLNAME => array('CONTENT_ID' => 0, 'FOLDER_ID' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
self::TYPE_FIELDNAME => array('content_id' => 0, 'folder_id' => 1, 'created_at' => 2, 'updated_at' => 3, ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('ContentId' => 0, 'FolderId' => 1, 'DefaultFolder' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('contentId' => 0, 'folderId' => 1, 'defaultFolder' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(ContentFolderTableMap::CONTENT_ID => 0, ContentFolderTableMap::FOLDER_ID => 1, ContentFolderTableMap::DEFAULT_FOLDER => 2, ContentFolderTableMap::CREATED_AT => 3, ContentFolderTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('CONTENT_ID' => 0, 'FOLDER_ID' => 1, 'DEFAULT_FOLDER' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('content_id' => 0, 'folder_id' => 1, 'default_folder' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -143,6 +148,7 @@ class ContentFolderTableMap extends TableMap
// columns
$this->addForeignPrimaryKey('CONTENT_ID', 'ContentId', 'INTEGER' , 'content', 'ID', true, null, null);
$this->addForeignPrimaryKey('FOLDER_ID', 'FolderId', 'INTEGER' , 'folder', 'ID', true, null, null);
$this->addColumn('DEFAULT_FOLDER', 'DefaultFolder', 'BOOLEAN', false, 1, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -358,11 +364,13 @@ class ContentFolderTableMap extends TableMap
if (null === $alias) {
$criteria->addSelectColumn(ContentFolderTableMap::CONTENT_ID);
$criteria->addSelectColumn(ContentFolderTableMap::FOLDER_ID);
$criteria->addSelectColumn(ContentFolderTableMap::DEFAULT_FOLDER);
$criteria->addSelectColumn(ContentFolderTableMap::CREATED_AT);
$criteria->addSelectColumn(ContentFolderTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.CONTENT_ID');
$criteria->addSelectColumn($alias . '.FOLDER_ID');
$criteria->addSelectColumn($alias . '.DEFAULT_FOLDER');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -184,7 +184,7 @@ class CurrencyTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'SET NULL', 'RESTRICT', 'Orders');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'RESTRICT', 'RESTRICT', 'Orders');
$this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), null, null, 'Carts');
$this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'CASCADE', null, 'ProductPrices');
$this->addRelation('CurrencyI18n', '\\Thelia\\Model\\CurrencyI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CurrencyI18ns');
@@ -210,7 +210,6 @@ class CurrencyTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
OrderTableMap::clearInstancePool();
ProductPriceTableMap::clearInstancePool();
CurrencyI18nTableMap::clearInstancePool();
}

View File

@@ -225,7 +225,7 @@ class CustomerTableMap extends TableMap
{
$this->addRelation('CustomerTitle', '\\Thelia\\Model\\CustomerTitle', RelationMap::MANY_TO_ONE, array('title_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('Address', '\\Thelia\\Model\\Address', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Addresses');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'RESTRICT', 'Orders');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'RESTRICT', 'RESTRICT', 'Orders');
$this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), null, null, 'Carts');
} // buildRelations()
@@ -249,7 +249,6 @@ class CustomerTableMap extends TableMap
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AddressTableMap::clearInstancePool();
OrderTableMap::clearInstancePool();
}
/**

View File

@@ -217,6 +217,7 @@ class LangTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'lang_id', ), 'RESTRICT', 'RESTRICT', 'Orders');
} // buildRelations()
/**

View File

@@ -184,6 +184,9 @@ class ModuleTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('OrderRelatedByPaymentModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'payment_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByPaymentModuleId');
$this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId');
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules');
$this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns');
} // buildRelations()
@@ -208,6 +211,7 @@ class ModuleTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AreaDeliveryModuleTableMap::clearInstancePool();
GroupModuleTableMap::clearInstancePool();
ModuleI18nTableMap::clearInstancePool();
}

View File

@@ -211,8 +211,8 @@ class OrderAddressTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('OrderRelatedByAddressInvoice', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'address_invoice', ), 'SET NULL', 'RESTRICT', 'OrdersRelatedByAddressInvoice');
$this->addRelation('OrderRelatedByAddressDelivery', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'address_delivery', ), 'SET NULL', 'RESTRICT', 'OrdersRelatedByAddressDelivery');
$this->addRelation('OrderRelatedByInvoiceOrderAddressId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'invoice_order_address_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByInvoiceOrderAddressId');
$this->addRelation('OrderRelatedByDeliveryOrderAddressId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_order_address_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryOrderAddressId');
} // buildRelations()
/**
@@ -227,15 +227,6 @@ class OrderAddressTableMap extends TableMap
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* Method to invalidate the instance pool of all tables related to order_address * by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
OrderTableMap::clearInstancePool();
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.

View File

@@ -160,7 +160,7 @@ class OrderStatusTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'status_id', ), 'SET NULL', 'RESTRICT', 'Orders');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'status_id', ), 'RESTRICT', 'RESTRICT', 'Orders');
$this->addRelation('OrderStatusI18n', '\\Thelia\\Model\\OrderStatusI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'OrderStatusI18ns');
} // buildRelations()
@@ -184,7 +184,6 @@ class OrderStatusTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
OrderTableMap::clearInstancePool();
OrderStatusI18nTableMap::clearInstancePool();
}

View File

@@ -85,14 +85,14 @@ class OrderTableMap extends TableMap
const CUSTOMER_ID = 'order.CUSTOMER_ID';
/**
* the column name for the ADDRESS_INVOICE field
* the column name for the INVOICE_ORDER_ADDRESS_ID field
*/
const ADDRESS_INVOICE = 'order.ADDRESS_INVOICE';
const INVOICE_ORDER_ADDRESS_ID = 'order.INVOICE_ORDER_ADDRESS_ID';
/**
* the column name for the ADDRESS_DELIVERY field
* the column name for the DELIVERY_ORDER_ADDRESS_ID field
*/
const ADDRESS_DELIVERY = 'order.ADDRESS_DELIVERY';
const DELIVERY_ORDER_ADDRESS_ID = 'order.DELIVERY_ORDER_ADDRESS_ID';
/**
* the column name for the INVOICE_DATE field
@@ -110,19 +110,19 @@ class OrderTableMap extends TableMap
const CURRENCY_RATE = 'order.CURRENCY_RATE';
/**
* the column name for the TRANSACTION field
* the column name for the TRANSACTION_REF field
*/
const TRANSACTION = 'order.TRANSACTION';
const TRANSACTION_REF = 'order.TRANSACTION_REF';
/**
* the column name for the DELIVERY_NUM field
* the column name for the DELIVERY_REF field
*/
const DELIVERY_NUM = 'order.DELIVERY_NUM';
const DELIVERY_REF = 'order.DELIVERY_REF';
/**
* the column name for the INVOICE field
* the column name for the INVOICE_REF field
*/
const INVOICE = 'order.INVOICE';
const INVOICE_REF = 'order.INVOICE_REF';
/**
* the column name for the POSTAGE field
@@ -130,14 +130,14 @@ class OrderTableMap extends TableMap
const POSTAGE = 'order.POSTAGE';
/**
* the column name for the PAYMENT field
* the column name for the PAYMENT_MODULE_ID field
*/
const PAYMENT = 'order.PAYMENT';
const PAYMENT_MODULE_ID = 'order.PAYMENT_MODULE_ID';
/**
* the column name for the CARRIER field
* the column name for the DELIVERY_MODULE_ID field
*/
const CARRIER = 'order.CARRIER';
const DELIVERY_MODULE_ID = 'order.DELIVERY_MODULE_ID';
/**
* the column name for the STATUS_ID field
@@ -145,9 +145,9 @@ class OrderTableMap extends TableMap
const STATUS_ID = 'order.STATUS_ID';
/**
* the column name for the LANG field
* the column name for the LANG_ID field
*/
const LANG = 'order.LANG';
const LANG_ID = 'order.LANG_ID';
/**
* the column name for the CREATED_AT field
@@ -171,11 +171,11 @@ class OrderTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'AddressInvoice', 'AddressDelivery', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'Transaction', 'DeliveryNum', 'Invoice', 'Postage', 'Payment', 'Carrier', 'StatusId', 'Lang', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'addressInvoice', 'addressDelivery', 'invoiceDate', 'currencyId', 'currencyRate', 'transaction', 'deliveryNum', 'invoice', 'postage', 'payment', 'carrier', 'statusId', 'lang', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::ADDRESS_INVOICE, OrderTableMap::ADDRESS_DELIVERY, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION, OrderTableMap::DELIVERY_NUM, OrderTableMap::INVOICE, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT, OrderTableMap::CARRIER, OrderTableMap::STATUS_ID, OrderTableMap::LANG, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'ADDRESS_INVOICE', 'ADDRESS_DELIVERY', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION', 'DELIVERY_NUM', 'INVOICE', 'POSTAGE', 'PAYMENT', 'CARRIER', 'STATUS_ID', 'LANG', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'address_invoice', 'address_delivery', 'invoice_date', 'currency_id', 'currency_rate', 'transaction', 'delivery_num', 'invoice', 'postage', 'payment', 'carrier', 'status_id', 'lang', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'InvoiceOrderAddressId', 'DeliveryOrderAddressId', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'TransactionRef', 'DeliveryRef', 'InvoiceRef', 'Postage', 'PaymentModuleId', 'DeliveryModuleId', 'StatusId', 'LangId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'invoiceOrderAddressId', 'deliveryOrderAddressId', 'invoiceDate', 'currencyId', 'currencyRate', 'transactionRef', 'deliveryRef', 'invoiceRef', 'postage', 'paymentModuleId', 'deliveryModuleId', 'statusId', 'langId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::INVOICE_ORDER_ADDRESS_ID, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION_REF, OrderTableMap::DELIVERY_REF, OrderTableMap::INVOICE_REF, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT_MODULE_ID, OrderTableMap::DELIVERY_MODULE_ID, OrderTableMap::STATUS_ID, OrderTableMap::LANG_ID, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'INVOICE_ORDER_ADDRESS_ID', 'DELIVERY_ORDER_ADDRESS_ID', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION_REF', 'DELIVERY_REF', 'INVOICE_REF', 'POSTAGE', 'PAYMENT_MODULE_ID', 'DELIVERY_MODULE_ID', 'STATUS_ID', 'LANG_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'invoice_order_address_id', 'delivery_order_address_id', 'invoice_date', 'currency_id', 'currency_rate', 'transaction_ref', 'delivery_ref', 'invoice_ref', 'postage', 'payment_module_id', 'delivery_module_id', 'status_id', 'lang_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
);
@@ -186,11 +186,11 @@ class OrderTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'AddressInvoice' => 3, 'AddressDelivery' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'Transaction' => 8, 'DeliveryNum' => 9, 'Invoice' => 10, 'Postage' => 11, 'Payment' => 12, 'Carrier' => 13, 'StatusId' => 14, 'Lang' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'addressInvoice' => 3, 'addressDelivery' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transaction' => 8, 'deliveryNum' => 9, 'invoice' => 10, 'postage' => 11, 'payment' => 12, 'carrier' => 13, 'statusId' => 14, 'lang' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::ADDRESS_INVOICE => 3, OrderTableMap::ADDRESS_DELIVERY => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION => 8, OrderTableMap::DELIVERY_NUM => 9, OrderTableMap::INVOICE => 10, OrderTableMap::POSTAGE => 11, OrderTableMap::PAYMENT => 12, OrderTableMap::CARRIER => 13, OrderTableMap::STATUS_ID => 14, OrderTableMap::LANG => 15, OrderTableMap::CREATED_AT => 16, OrderTableMap::UPDATED_AT => 17, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'ADDRESS_INVOICE' => 3, 'ADDRESS_DELIVERY' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION' => 8, 'DELIVERY_NUM' => 9, 'INVOICE' => 10, 'POSTAGE' => 11, 'PAYMENT' => 12, 'CARRIER' => 13, 'STATUS_ID' => 14, 'LANG' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'address_invoice' => 3, 'address_delivery' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction' => 8, 'delivery_num' => 9, 'invoice' => 10, 'postage' => 11, 'payment' => 12, 'carrier' => 13, 'status_id' => 14, 'lang' => 15, 'created_at' => 16, 'updated_at' => 17, ),
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'InvoiceOrderAddressId' => 3, 'DeliveryOrderAddressId' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'TransactionRef' => 8, 'DeliveryRef' => 9, 'InvoiceRef' => 10, 'Postage' => 11, 'PaymentModuleId' => 12, 'DeliveryModuleId' => 13, 'StatusId' => 14, 'LangId' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'invoiceOrderAddressId' => 3, 'deliveryOrderAddressId' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transactionRef' => 8, 'deliveryRef' => 9, 'invoiceRef' => 10, 'postage' => 11, 'paymentModuleId' => 12, 'deliveryModuleId' => 13, 'statusId' => 14, 'langId' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::INVOICE_ORDER_ADDRESS_ID => 3, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION_REF => 8, OrderTableMap::DELIVERY_REF => 9, OrderTableMap::INVOICE_REF => 10, OrderTableMap::POSTAGE => 11, OrderTableMap::PAYMENT_MODULE_ID => 12, OrderTableMap::DELIVERY_MODULE_ID => 13, OrderTableMap::STATUS_ID => 14, OrderTableMap::LANG_ID => 15, OrderTableMap::CREATED_AT => 16, OrderTableMap::UPDATED_AT => 17, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'INVOICE_ORDER_ADDRESS_ID' => 3, 'DELIVERY_ORDER_ADDRESS_ID' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION_REF' => 8, 'DELIVERY_REF' => 9, 'INVOICE_REF' => 10, 'POSTAGE' => 11, 'PAYMENT_MODULE_ID' => 12, 'DELIVERY_MODULE_ID' => 13, 'STATUS_ID' => 14, 'LANG_ID' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'invoice_order_address_id' => 3, 'delivery_order_address_id' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction_ref' => 8, 'delivery_ref' => 9, 'invoice_ref' => 10, 'postage' => 11, 'payment_module_id' => 12, 'delivery_module_id' => 13, 'status_id' => 14, 'lang_id' => 15, 'created_at' => 16, 'updated_at' => 17, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
);
@@ -211,21 +211,21 @@ class OrderTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', false, 45, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 45, null);
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null);
$this->addForeignKey('ADDRESS_INVOICE', 'AddressInvoice', 'INTEGER', 'order_address', 'ID', false, null, null);
$this->addForeignKey('ADDRESS_DELIVERY', 'AddressDelivery', 'INTEGER', 'order_address', 'ID', false, null, null);
$this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', false, null, null);
$this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', false, null, null);
$this->addForeignKey('INVOICE_ORDER_ADDRESS_ID', 'InvoiceOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
$this->addForeignKey('DELIVERY_ORDER_ADDRESS_ID', 'DeliveryOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
$this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', true, null, null);
$this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null);
$this->addColumn('CURRENCY_RATE', 'CurrencyRate', 'FLOAT', true, null, null);
$this->addColumn('TRANSACTION', 'Transaction', 'VARCHAR', false, 100, null);
$this->addColumn('DELIVERY_NUM', 'DeliveryNum', 'VARCHAR', false, 100, null);
$this->addColumn('INVOICE', 'Invoice', 'VARCHAR', false, 100, null);
$this->addColumn('POSTAGE', 'Postage', 'FLOAT', false, null, null);
$this->addColumn('PAYMENT', 'Payment', 'VARCHAR', true, 45, null);
$this->addColumn('CARRIER', 'Carrier', 'VARCHAR', true, 45, null);
$this->addForeignKey('STATUS_ID', 'StatusId', 'INTEGER', 'order_status', 'ID', false, null, null);
$this->addColumn('LANG', 'Lang', 'VARCHAR', true, 10, null);
$this->addColumn('TRANSACTION_REF', 'TransactionRef', 'VARCHAR', false, 100, null);
$this->addColumn('DELIVERY_REF', 'DeliveryRef', 'VARCHAR', false, 100, null);
$this->addColumn('INVOICE_REF', 'InvoiceRef', 'VARCHAR', false, 100, null);
$this->addColumn('POSTAGE', 'Postage', 'FLOAT', true, null, null);
$this->addForeignKey('PAYMENT_MODULE_ID', 'PaymentModuleId', 'INTEGER', 'module', 'ID', true, null, null);
$this->addForeignKey('DELIVERY_MODULE_ID', 'DeliveryModuleId', 'INTEGER', 'module', 'ID', true, null, null);
$this->addForeignKey('STATUS_ID', 'StatusId', 'INTEGER', 'order_status', 'ID', true, null, null);
$this->addForeignKey('LANG_ID', 'LangId', 'INTEGER', 'lang', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -235,11 +235,14 @@ class OrderTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('OrderAddressRelatedByAddressInvoice', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('address_invoice' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('OrderAddressRelatedByAddressDelivery', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('address_delivery' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('OrderStatus', '\\Thelia\\Model\\OrderStatus', RelationMap::MANY_TO_ONE, array('status_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('OrderAddressRelatedByInvoiceOrderAddressId', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('invoice_order_address_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('OrderAddressRelatedByDeliveryOrderAddressId', '\\Thelia\\Model\\OrderAddress', RelationMap::MANY_TO_ONE, array('delivery_order_address_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('OrderStatus', '\\Thelia\\Model\\OrderStatus', RelationMap::MANY_TO_ONE, array('status_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('ModuleRelatedByPaymentModuleId', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('payment_module_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('ModuleRelatedByDeliveryModuleId', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('delivery_module_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('Lang', '\\Thelia\\Model\\Lang', RelationMap::MANY_TO_ONE, array('lang_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('OrderProduct', '\\Thelia\\Model\\OrderProduct', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'OrderProducts');
$this->addRelation('CouponOrder', '\\Thelia\\Model\\CouponOrder', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'CouponOrders');
} // buildRelations()
@@ -408,38 +411,38 @@ class OrderTableMap extends TableMap
$criteria->addSelectColumn(OrderTableMap::ID);
$criteria->addSelectColumn(OrderTableMap::REF);
$criteria->addSelectColumn(OrderTableMap::CUSTOMER_ID);
$criteria->addSelectColumn(OrderTableMap::ADDRESS_INVOICE);
$criteria->addSelectColumn(OrderTableMap::ADDRESS_DELIVERY);
$criteria->addSelectColumn(OrderTableMap::INVOICE_ORDER_ADDRESS_ID);
$criteria->addSelectColumn(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID);
$criteria->addSelectColumn(OrderTableMap::INVOICE_DATE);
$criteria->addSelectColumn(OrderTableMap::CURRENCY_ID);
$criteria->addSelectColumn(OrderTableMap::CURRENCY_RATE);
$criteria->addSelectColumn(OrderTableMap::TRANSACTION);
$criteria->addSelectColumn(OrderTableMap::DELIVERY_NUM);
$criteria->addSelectColumn(OrderTableMap::INVOICE);
$criteria->addSelectColumn(OrderTableMap::TRANSACTION_REF);
$criteria->addSelectColumn(OrderTableMap::DELIVERY_REF);
$criteria->addSelectColumn(OrderTableMap::INVOICE_REF);
$criteria->addSelectColumn(OrderTableMap::POSTAGE);
$criteria->addSelectColumn(OrderTableMap::PAYMENT);
$criteria->addSelectColumn(OrderTableMap::CARRIER);
$criteria->addSelectColumn(OrderTableMap::PAYMENT_MODULE_ID);
$criteria->addSelectColumn(OrderTableMap::DELIVERY_MODULE_ID);
$criteria->addSelectColumn(OrderTableMap::STATUS_ID);
$criteria->addSelectColumn(OrderTableMap::LANG);
$criteria->addSelectColumn(OrderTableMap::LANG_ID);
$criteria->addSelectColumn(OrderTableMap::CREATED_AT);
$criteria->addSelectColumn(OrderTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.REF');
$criteria->addSelectColumn($alias . '.CUSTOMER_ID');
$criteria->addSelectColumn($alias . '.ADDRESS_INVOICE');
$criteria->addSelectColumn($alias . '.ADDRESS_DELIVERY');
$criteria->addSelectColumn($alias . '.INVOICE_ORDER_ADDRESS_ID');
$criteria->addSelectColumn($alias . '.DELIVERY_ORDER_ADDRESS_ID');
$criteria->addSelectColumn($alias . '.INVOICE_DATE');
$criteria->addSelectColumn($alias . '.CURRENCY_ID');
$criteria->addSelectColumn($alias . '.CURRENCY_RATE');
$criteria->addSelectColumn($alias . '.TRANSACTION');
$criteria->addSelectColumn($alias . '.DELIVERY_NUM');
$criteria->addSelectColumn($alias . '.INVOICE');
$criteria->addSelectColumn($alias . '.TRANSACTION_REF');
$criteria->addSelectColumn($alias . '.DELIVERY_REF');
$criteria->addSelectColumn($alias . '.INVOICE_REF');
$criteria->addSelectColumn($alias . '.POSTAGE');
$criteria->addSelectColumn($alias . '.PAYMENT');
$criteria->addSelectColumn($alias . '.CARRIER');
$criteria->addSelectColumn($alias . '.PAYMENT_MODULE_ID');
$criteria->addSelectColumn($alias . '.DELIVERY_MODULE_ID');
$criteria->addSelectColumn($alias . '.STATUS_ID');
$criteria->addSelectColumn($alias . '.LANG');
$criteria->addSelectColumn($alias . '.LANG_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -57,7 +57,7 @@ class ProductCategoryTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 5;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductCategoryTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 4;
const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the PRODUCT_ID field
@@ -79,6 +79,11 @@ class ProductCategoryTableMap extends TableMap
*/
const CATEGORY_ID = 'product_category.CATEGORY_ID';
/**
* the column name for the DEFAULT_CATEGORY field
*/
const DEFAULT_CATEGORY = 'product_category.DEFAULT_CATEGORY';
/**
* the column name for the CREATED_AT field
*/
@@ -101,12 +106,12 @@ class ProductCategoryTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('ProductId', 'CategoryId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('productId', 'categoryId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID, ProductCategoryTableMap::CATEGORY_ID, ProductCategoryTableMap::CREATED_AT, ProductCategoryTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('PRODUCT_ID', 'CATEGORY_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('product_id', 'category_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('ProductId', 'CategoryId', 'DefaultCategory', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('productId', 'categoryId', 'defaultCategory', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID, ProductCategoryTableMap::CATEGORY_ID, ProductCategoryTableMap::DEFAULT_CATEGORY, ProductCategoryTableMap::CREATED_AT, ProductCategoryTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('PRODUCT_ID', 'CATEGORY_ID', 'DEFAULT_CATEGORY', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('product_id', 'category_id', 'default_category', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -116,12 +121,12 @@ class ProductCategoryTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('ProductId' => 0, 'CategoryId' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
self::TYPE_STUDLYPHPNAME => array('productId' => 0, 'categoryId' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID => 0, ProductCategoryTableMap::CATEGORY_ID => 1, ProductCategoryTableMap::CREATED_AT => 2, ProductCategoryTableMap::UPDATED_AT => 3, ),
self::TYPE_RAW_COLNAME => array('PRODUCT_ID' => 0, 'CATEGORY_ID' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
self::TYPE_FIELDNAME => array('product_id' => 0, 'category_id' => 1, 'created_at' => 2, 'updated_at' => 3, ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('ProductId' => 0, 'CategoryId' => 1, 'DefaultCategory' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('productId' => 0, 'categoryId' => 1, 'defaultCategory' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(ProductCategoryTableMap::PRODUCT_ID => 0, ProductCategoryTableMap::CATEGORY_ID => 1, ProductCategoryTableMap::DEFAULT_CATEGORY => 2, ProductCategoryTableMap::CREATED_AT => 3, ProductCategoryTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('PRODUCT_ID' => 0, 'CATEGORY_ID' => 1, 'DEFAULT_CATEGORY' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('product_id' => 0, 'category_id' => 1, 'default_category' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -143,6 +148,7 @@ class ProductCategoryTableMap extends TableMap
// columns
$this->addForeignPrimaryKey('PRODUCT_ID', 'ProductId', 'INTEGER' , 'product', 'ID', true, null, null);
$this->addForeignPrimaryKey('CATEGORY_ID', 'CategoryId', 'INTEGER' , 'category', 'ID', true, null, null);
$this->addColumn('DEFAULT_CATEGORY', 'DefaultCategory', 'BOOLEAN', false, 1, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -358,11 +364,13 @@ class ProductCategoryTableMap extends TableMap
if (null === $alias) {
$criteria->addSelectColumn(ProductCategoryTableMap::PRODUCT_ID);
$criteria->addSelectColumn(ProductCategoryTableMap::CATEGORY_ID);
$criteria->addSelectColumn(ProductCategoryTableMap::DEFAULT_CATEGORY);
$criteria->addSelectColumn(ProductCategoryTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductCategoryTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
$criteria->addSelectColumn($alias . '.CATEGORY_ID');
$criteria->addSelectColumn($alias . '.DEFAULT_CATEGORY');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -4,7 +4,10 @@ namespace Thelia\Model;
use Thelia\Model\Base\Order as BaseOrder;
class Order extends BaseOrder {
class Order extends BaseOrder
{
public $chosenDeliveryAddress = null;
public $chosenInvoiceModule = null;
/**
* calculate the total amount

View File

@@ -38,7 +38,7 @@ class Product extends BaseProduct
public function getTaxedPrice(Country $country)
{
$taxCalculator = new Calculator();
return $taxCalculator->load($this, $country)->getTaxedPrice($this->getRealLowestPrice());
return round($taxCalculator->load($this, $country)->getTaxedPrice($this->getRealLowestPrice()), 2);
}
/**

View File

@@ -32,12 +32,12 @@ class ProductSaleElements extends BaseProductSaleElements
public function getTaxedPrice(Country $country)
{
$taxCalculator = new Calculator();
return $taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPrice());
return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPrice()), 2);
}
public function getTaxedPromoPrice(Country $country)
{
$taxCalculator = new Calculator();
return $taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPromoPrice());
return round($taxCalculator->load($this->getProduct(), $country)->getTaxedPrice($this->getPromoPrice()), 2);
}
}

View File

@@ -28,6 +28,9 @@ use Symfony\Component\DependencyInjection\ContainerAware;
abstract class BaseModule extends ContainerAware
{
const CLASSIC_MODULE_TYPE = 1;
const DELIVERY_MODULE_TYPE = 2;
const PAYMENT_MODULE_TYPE = 3;
public function __construct()
{

View File

@@ -23,13 +23,16 @@
namespace Thelia\Module;
use Thelia\Model\Country;
interface DeliveryModuleInterface extends BaseModuleInterface
{
/**
*
* calculate and return delivery price
*
* @param Country $country
*
* @return mixed
*/
public function calculate($country = null);
public function calculate(Country $country);
}

View File

@@ -135,6 +135,8 @@ try {
\Thelia\Model\FolderDocumentQuery::create()->find()->delete();
\Thelia\Model\ContentDocumentQuery::create()->find()->delete();
\Thelia\Model\CouponQuery::create()->find()->delete();
$stmt = $con->prepare("SET foreign_key_checks = 1");
$stmt->execute();
@@ -204,7 +206,7 @@ try {
$featureList = array();
for($i=0; $i<4; $i++) {
$feature = new Thelia\Model\Feature();
$feature->setVisible(rand(1, 10)>7 ? 0 : 1);
$feature->setVisible(1);
$feature->setPosition($i);
setI18n($faker, $feature);
@@ -278,7 +280,7 @@ try {
for($i=0; $i<4; $i++) {
$folder = new Thelia\Model\Folder();
$folder->setParent(0);
$folder->setVisible(rand(1, 10)>7 ? 0 : 1);
$folder->setVisible(1);
$folder->setPosition($i);
setI18n($faker, $folder);
@@ -295,7 +297,7 @@ try {
for($j=1; $j<rand(0, 5); $j++) {
$subfolder = new Thelia\Model\Folder();
$subfolder->setParent($folder->getId());
$subfolder->setVisible(rand(1, 10)>7 ? 0 : 1);
$subfolder->setVisible(1);
$subfolder->setPosition($j);
setI18n($faker, $subfolder);
@@ -312,7 +314,7 @@ try {
for($k=0; $k<rand(0, 5); $k++) {
$content = new Thelia\Model\Content();
$content->addFolder($subfolder);
$content->setVisible(rand(1, 10)>7 ? 0 : 1);
$content->setVisible(1);
$content->setPosition($k);
setI18n($faker, $content);
@@ -456,7 +458,7 @@ function createProduct($faker, $category, $position, $template, &$productIdList)
$product = new Thelia\Model\Product();
$product->setRef($category->getId() . '_' . $position . '_' . $faker->randomNumber(8));
$product->addCategory($category);
$product->setVisible(rand(1, 10)>7 ? 0 : 1);
$product->setVisible(1);
$product->setPosition($position);
$product->setTaxRuleId(1);
$product->setTemplate($template);
@@ -482,7 +484,7 @@ function createCategory($faker, $parent, $position, &$categoryIdList, $contentId
{
$category = new Thelia\Model\Category();
$category->setParent($parent);
$category->setVisible(rand(1, 10)>7 ? 0 : 1);
$category->setVisible(1);
$category->setPosition($position);
setI18n($faker, $category);

View File

@@ -31,7 +31,13 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat
INSERT INTO `module` (`id`, `code`, `type`, `activate`, `position`, `full_namespace`, `created_at`, `updated_at`) VALUES
(1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW());
(1, 'DebugBar', 1, 1, 1, 'DebugBar\\DebugBar', NOW(), NOW()),
(2, 'Colissimo', 2, 1, 1, 'Colissimo\\Colissimo', NOW(), NOW());
INSERT INTO `thelia_2`.`module_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `postscriptum`) VALUES
('2', 'en_US', '72h delivery', NULL, NULL, NULL),
('2', 'fr_FR', 'Livraison par colissimo en 72h', NULL, NULL, NULL);
INSERT INTO `customer_title`(`id`, `by_default`, `position`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NOW(), NOW()),
@@ -46,13 +52,13 @@ INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES
(3, 'fr_FR', 'Mlle', 'Madamemoiselle'),
(3, 'en_US', 'Miss', 'Miss');
INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate`, `position` ,`by_default` ,`created_at` ,`updated_at`)
INSERT INTO `currency` (`id`, `code`, `symbol`, `rate`, `position`, `by_default`, `created_at`, `updated_at`)
VALUES
(1, 'EUR', '', '1', 1, '1', NOW() , NOW()),
(1, 'EUR', '', '1', 1, '1', NOW(), NOW()),
(2, 'USD', '$', '1.26', 2, '0', NOW(), NOW()),
(3, 'GBP', '£', '0.89', 3, '0', NOW(), NOW());
INSERT INTO `currency_i18n` (`id` ,`locale` ,`name`)
INSERT INTO `currency_i18n` (`id`, `locale`, `name`)
VALUES
(1, 'fr_FR', 'Euro'),
(1, 'en_US', 'Euro'),

View File

@@ -66,11 +66,13 @@ CREATE TABLE `product_category`
(
`product_id` INTEGER NOT NULL,
`category_id` INTEGER NOT NULL,
`default_category` TINYINT(1),
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`product_id`,`category_id`),
INDEX `idx_product_has_category_category1` (`category_id`),
INDEX `idx_product_has_category_product1` (`product_id`),
INDEX `idx_product_has_category_default` (`default_category`),
CONSTRAINT `fk_product_has_category_product1`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`)
@@ -632,54 +634,73 @@ DROP TABLE IF EXISTS `order`;
CREATE TABLE `order`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`ref` VARCHAR(45),
`ref` VARCHAR(45) NOT NULL,
`customer_id` INTEGER NOT NULL,
`address_invoice` INTEGER,
`address_delivery` INTEGER,
`invoice_date` DATE,
`currency_id` INTEGER,
`invoice_order_address_id` INTEGER NOT NULL,
`delivery_order_address_id` INTEGER NOT NULL,
`invoice_date` DATE NOT NULL,
`currency_id` INTEGER NOT NULL,
`currency_rate` FLOAT NOT NULL,
`transaction` VARCHAR(100),
`delivery_num` VARCHAR(100),
`invoice` VARCHAR(100),
`postage` FLOAT,
`payment` VARCHAR(45) NOT NULL,
`carrier` VARCHAR(45) NOT NULL,
`status_id` INTEGER,
`lang` VARCHAR(10) NOT NULL,
`transaction_ref` VARCHAR(100) COMMENT 'transaction reference - usually use to identify a transaction with banking modules',
`delivery_ref` VARCHAR(100) COMMENT 'delivery reference - usually use to identify a delivery progress on a distant delivery tracker website',
`invoice_ref` VARCHAR(100) COMMENT 'the invoice reference',
`postage` FLOAT NOT NULL,
`payment_module_id` INTEGER NOT NULL,
`delivery_module_id` INTEGER NOT NULL,
`status_id` INTEGER NOT NULL,
`lang_id` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
UNIQUE INDEX `ref_UNIQUE` (`ref`),
INDEX `idx_order_currency_id` (`currency_id`),
INDEX `idx_order_customer_id` (`customer_id`),
INDEX `idx_order_address_invoice` (`address_invoice`),
INDEX `idx_order_address_delivery` (`address_delivery`),
INDEX `idx_order_invoice_order_address_id` (`invoice_order_address_id`),
INDEX `idx_order_delivery_order_address_id` (`delivery_order_address_id`),
INDEX `idx_order_status_id` (`status_id`),
INDEX `fk_order_payment_module_id_idx` (`payment_module_id`),
INDEX `fk_order_delivery_module_id_idx` (`delivery_module_id`),
INDEX `fk_order_lang_id_idx` (`lang_id`),
CONSTRAINT `fk_order_currency_id`
FOREIGN KEY (`currency_id`)
REFERENCES `currency` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
ON DELETE RESTRICT,
CONSTRAINT `fk_order_customer_id`
FOREIGN KEY (`customer_id`)
REFERENCES `customer` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
CONSTRAINT `fk_order_address_invoice`
FOREIGN KEY (`address_invoice`)
ON DELETE RESTRICT,
CONSTRAINT `fk_order_invoice_order_address_id`
FOREIGN KEY (`invoice_order_address_id`)
REFERENCES `order_address` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
CONSTRAINT `fk_order_address_delivery`
FOREIGN KEY (`address_delivery`)
ON DELETE RESTRICT,
CONSTRAINT `fk_order_delivery_order_address_id`
FOREIGN KEY (`delivery_order_address_id`)
REFERENCES `order_address` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
ON DELETE RESTRICT,
CONSTRAINT `fk_order_status_id`
FOREIGN KEY (`status_id`)
REFERENCES `order_status` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL
ON DELETE RESTRICT,
CONSTRAINT `fk_order_payment_module_id`
FOREIGN KEY (`payment_module_id`)
REFERENCES `module` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_order_delivery_module_id`
FOREIGN KEY (`delivery_module_id`)
REFERENCES `module` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT `fk_order_lang_id`
FOREIGN KEY (`lang_id`)
REFERENCES `lang` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
@@ -852,32 +873,38 @@ CREATE TABLE `area`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`unit` FLOAT,
`postage` FLOAT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- delivzone
-- area_delivery_module
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `delivzone`;
DROP TABLE IF EXISTS `area_delivery_module`;
CREATE TABLE `delivzone`
CREATE TABLE `area_delivery_module`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER,
`delivery` VARCHAR(45) NOT NULL,
`area_id` INTEGER NOT NULL,
`delivery_module_id` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `idx_delivzone_area_id` (`area_id`),
CONSTRAINT `fk_delivzone_area_id`
INDEX `idx_area_delivery_module_area_id` (`area_id`),
INDEX `idx_area_delivery_module_delivery_module_id` (`delivery_module_id`),
CONSTRAINT `fk_area_delivery_module_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL
ON DELETE CASCADE,
CONSTRAINT `idx_area_delivery_module_delivery_module_id`
FOREIGN KEY (`delivery_module_id`)
REFERENCES `module` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
@@ -1128,11 +1155,13 @@ CREATE TABLE `content_folder`
(
`content_id` INTEGER NOT NULL,
`folder_id` INTEGER NOT NULL,
`default_folder` TINYINT(1),
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`content_id`,`folder_id`),
INDEX `idx_content_folder_content_id` (`content_id`),
INDEX `idx_content_folder_folder_id` (`folder_id`),
INDEX `idx_content_folder_default` (`default_folder`),
CONSTRAINT `fk_content_folder_content_id`
FOREIGN KEY (`content_id`)
REFERENCES `content` (`id`)

View File

@@ -56,6 +56,7 @@
<table isCrossRef="true" name="product_category" namespace="Thelia\Model">
<column name="product_id" primaryKey="true" required="true" type="INTEGER" />
<column name="category_id" primaryKey="true" required="true" type="INTEGER" />
<column name="default_category" type="BOOLEAN" />
<foreign-key foreignTable="product" name="fk_product_has_category_product1" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
@@ -68,6 +69,9 @@
<index name="idx_product_has_category_product1">
<index-column name="product_id" />
</index>
<index name="idx_product_has_category_default">
<index-column name="default_category" />
</index>
<behavior name="timestampable" />
</table>
<table name="country" namespace="Thelia\Model">
@@ -491,51 +495,72 @@
</table>
<table name="order" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="ref" size="45" type="VARCHAR" />
<column name="ref" required="true" size="45" type="VARCHAR" />
<column name="customer_id" required="true" type="INTEGER" />
<column name="address_invoice" type="INTEGER" />
<column name="address_delivery" type="INTEGER" />
<column name="invoice_date" type="DATE" />
<column name="currency_id" type="INTEGER" />
<column name="invoice_order_address_id" required="true" type="INTEGER" />
<column name="delivery_order_address_id" required="true" type="INTEGER" />
<column name="invoice_date" required="true" type="DATE" />
<column name="currency_id" required="true" type="INTEGER" />
<column name="currency_rate" required="true" type="FLOAT" />
<column name="transaction" size="100" type="VARCHAR" />
<column name="delivery_num" size="100" type="VARCHAR" />
<column name="invoice" size="100" type="VARCHAR" />
<column name="postage" type="FLOAT" />
<column name="payment" required="true" size="45" type="VARCHAR" />
<column name="carrier" required="true" size="45" type="VARCHAR" />
<column name="status_id" type="INTEGER" />
<column name="lang" required="true" size="10" type="VARCHAR" />
<foreign-key foreignTable="currency" name="fk_order_currency_id" onDelete="SET NULL" onUpdate="RESTRICT">
<column description="transaction reference - usually use to identify a transaction with banking modules" name="transaction_ref" size="100" type="VARCHAR" />
<column description="delivery reference - usually use to identify a delivery progress on a distant delivery tracker website" name="delivery_ref" size="100" type="VARCHAR" />
<column description="the invoice reference" name="invoice_ref" size="100" type="VARCHAR" />
<column name="postage" required="true" type="FLOAT" />
<column name="payment_module_id" required="true" type="INTEGER" />
<column name="delivery_module_id" required="true" type="INTEGER" />
<column name="status_id" required="true" type="INTEGER" />
<column name="lang_id" required="true" type="INTEGER" />
<foreign-key foreignTable="currency" name="fk_order_currency_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="currency_id" />
</foreign-key>
<foreign-key foreignTable="customer" name="fk_order_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
<foreign-key foreignTable="customer" name="fk_order_customer_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="customer_id" />
</foreign-key>
<foreign-key foreignTable="order_address" name="fk_order_address_invoice" onDelete="SET NULL" onUpdate="RESTRICT">
<reference foreign="id" local="address_invoice" />
<foreign-key foreignTable="order_address" name="fk_order_invoice_order_address_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="invoice_order_address_id" />
</foreign-key>
<foreign-key foreignTable="order_address" name="fk_order_address_delivery" onDelete="SET NULL" onUpdate="RESTRICT">
<reference foreign="id" local="address_delivery" />
<foreign-key foreignTable="order_address" name="fk_order_delivery_order_address_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_order_address_id" />
</foreign-key>
<foreign-key foreignTable="order_status" name="fk_order_status_id" onDelete="SET NULL" onUpdate="RESTRICT">
<foreign-key foreignTable="order_status" name="fk_order_status_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="status_id" />
</foreign-key>
<foreign-key foreignTable="module" name="fk_order_payment_module_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="payment_module_id" />
</foreign-key>
<foreign-key foreignTable="module" name="fk_order_delivery_module_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_module_id" />
</foreign-key>
<foreign-key foreignTable="lang" name="fk_order_lang_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="lang_id" />
</foreign-key>
<index name="idx_order_currency_id">
<index-column name="currency_id" />
</index>
<index name="idx_order_customer_id">
<index-column name="customer_id" />
</index>
<index name="idx_order_address_invoice">
<index-column name="address_invoice" />
<index name="idx_order_invoice_order_address_id">
<index-column name="invoice_order_address_id" />
</index>
<index name="idx_order_address_delivery">
<index-column name="address_delivery" />
<index name="idx_order_delivery_order_address_id">
<index-column name="delivery_order_address_id" />
</index>
<index name="idx_order_status_id">
<index-column name="status_id" />
</index>
<unique name="ref_UNIQUE">
<unique-column name="ref" />
</unique>
<index name="fk_order_payment_module_id_idx">
<index-column name="payment_module_id" />
</index>
<index name="fk_order_delivery_module_id_idx">
<index-column name="delivery_module_id" />
</index>
<index name="fk_order_lang_id_idx">
<index-column name="lang_id" />
</index>
<behavior name="timestampable" />
</table>
<table name="currency" namespace="Thelia\Model">
@@ -651,19 +676,25 @@
<table name="area" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="name" required="true" size="100" type="VARCHAR" />
<column name="unit" type="FLOAT" />
<column name="postage" type="FLOAT" />
<behavior name="timestampable" />
</table>
<table name="delivzone" namespace="Thelia\Model">
<table name="area_delivery_module" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="area_id" type="INTEGER" />
<column name="delivery" required="true" size="45" type="VARCHAR" />
<foreign-key foreignTable="area" name="fk_delivzone_area_id" onDelete="SET NULL" onUpdate="RESTRICT">
<column name="area_id" required="true" type="INTEGER" />
<column name="delivery_module_id" required="true" type="INTEGER" />
<foreign-key foreignTable="area" name="fk_area_delivery_module_area_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="area_id" />
</foreign-key>
<index name="idx_delivzone_area_id">
<foreign-key foreignTable="module" name="idx_area_delivery_module_delivery_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="delivery_module_id" />
</foreign-key>
<index name="idx_area_delivery_module_area_id">
<index-column name="area_id" />
</index>
<index name="idx_area_delivery_module_delivery_module_id">
<index-column name="delivery_module_id" />
</index>
<behavior name="timestampable" />
</table>
<table name="group" namespace="Thelia\Model">
@@ -861,6 +892,7 @@
<table isCrossRef="true" name="content_folder" namespace="Thelia\Model">
<column name="content_id" primaryKey="true" required="true" type="INTEGER" />
<column name="folder_id" primaryKey="true" required="true" type="INTEGER" />
<column name="default_folder" type="BOOLEAN" />
<foreign-key foreignTable="content" name="fk_content_folder_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="content_id" />
</foreign-key>
@@ -873,6 +905,9 @@
<index name="idx_content_folder_folder_id">
<index-column name="folder_id" />
</index>
<index name="idx_content_folder_default">
<index-column name="default_folder" />
</index>
<behavior name="timestampable" />
</table>
<table name="cart" namespace="Thelia\Model">

View File

@@ -25,6 +25,7 @@ namespace Colissimo;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Model\Country;
use Thelia\Module\BaseModule;
use Thelia\Module\DeliveryModuleInterface;
@@ -57,10 +58,10 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
*
* calculate and return delivery price
*
* @param null $country
* @param Country $country
* @return mixed
*/
public function calculate($country = null)
public function calculate(Country $country)
{
// TODO: Implement calculate() method.
return 2;

174
templates/default/cart.html Normal file
View File

@@ -0,0 +1,174 @@
{extends file="layout.tpl"}
{block name="breadcrumb"}
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">You are here: </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{navigate to="index"}" itemprop="url"><span itemprop="title">Home</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">Cart</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
{/block}
{block name="main-content"}
<div class="main">
<article id="cart" class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">Your Cart</h1>
<div class="btn-group checkout-progress">
<a href="#" role="button" class="btn btn-step active"><span class="step-nb">1</span> <span class="step-label">Your Cart</span></a>
<a href="#" role="button" class="btn btn-step disabled"><span class="step-nb">2</span> <span class="step-label">Billing and delivery</span></a>
<a href="#" role="button" class="btn btn-step disabled"><span class="step-nb">3</span> <span class="step-label">Check my order</span></a>
<a href="#" role="button" class="btn btn-step disabled"><span class="step-nb">4</span> <span class="step-label">Secure payment</span></a>
</div>
<table class="table table-cart">
<colgroup>
<col width="150">
<col>
<col width="150">
<col width="150">
<col width="150">
</colgroup>
<thead>
<tr>
<th class="image">&nbsp;</th>
<th class="product">
<span class="hidden-xs">Product Name</span>
<span class="visible-xs">Name</span>
</th>
<th class="unitprice">
<span class="hidden-xs">Unit Price</span>
<span class="visible-xs">Price</span>
</th>
<th class="qty">
<span class="hidden-xs">Quantity</span>
<span class="visible-xs">Qty</span>
</th>
<th class="subprice">
<span class="hidden-xs">Total <abbr title="Tax Inclusive">TTC</abbr></span>
<span class="visible-xs">Total</span>
</th>
</tr>
</thead>
<tbody>
{loop type="cart" name="cartloop"}
<tr>
<td class="image">
<a href="{$PRODUCT_URL}" class="thumbnail">
{assign "cart_count" $LOOP_COUNT}
{ifloop rel='product-image'}
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="85" force_return="true"}
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}"></a>
{/loop}
{/ifloop}
{elseloop rel="product-image"}
{images file='assets/img/product/1/118x85.png'}<img itemprop="image" src="{$asset_url}" alt="Product #{$cart_count}">{/images}
{/elseloop}
</td>
<td class="product" >
<h3 class="name"><a href="product-details.php">
Product #{$LOOP_COUNT}
</a></h3>
<div class="product-options">
<dl class="dl-horizontal">
<dt>Available :</dt>
<dd>In Stock</dd>
<dt>No.</dt>
<dd>{$REF}</dd>
{*<dt>Select Size</dt>
<dd>Large</dd>
<dt>Select Delivery Date</dt>
<dd>Jan 2, 2013</dd>
<dt>Additional Option</dt>
<dd>Option 1</dd>*}
</dl>
</div>
<a href="{url path="/cart/delete/{$ITEM_ID}"}" class="btn btn-remove">Remove</a>
</td>
<td class="unitprice">
{if $IS_PROMO == 1}
{assign "real_price" $PROMO_TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$PROMO_TAXED_PRICE}</span></div>
<small class="old-price">instead of <span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></small>
{else}
{assign "real_price" $TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></div>
{/if}
</td>
<td class="qty">
<div class="form-group group-qty">
<form action="{url path="/cart/update"}" method="post" role="form">
<input type="hidden" name="cart_item" value="{$ITEM_ID}">
<select name="quantity" class="form-control js-update-quantity">
{for $will=1 to $STOCK}
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
{/for}
</select>
</form>
</div>
</td>
<td class="subprice">
<span class="price">{currency attr="symbol"} {$real_price * $QUANTITY}</span>
</td>
</tr>
{/loop}
</tbody>
<tfoot>
<tr >
<td colspan="3" class="empty">&nbsp;</td>
<th class="total">Total <abbr title="Tax Inclusive">TTC</abbr></th>
<td class="total">
<div class="total-price">
<span class="price">{currency attr="symbol"} {cart attr="total_taxed_price"}</span>
</div>
</td>
</tr>
</tfoot>
</table>
<a href="{navigate to="index"}" role="button" class="btn btn-continue-shopping"><span>Continue Shopping</span></a>
<a href="{url path="/order/delivery"}" class="btn btn-checkout">Proceed checkout</a>
</article>
<aside id="products-upsell" role="complementary" aria-labelledby="products-upsell-label">
<div class="products-heading">
<h3 id="products-upsell-label">Upsell Products</h3>
</div>
<div class="products-content">
<ul class="products-grid product-col-<?php echo $product_upsell; ?> hover-effect">
<?php
// Product Parameters
$has_description = false; // Product without description
$has_btn = false; // Product without button (Add to Cart)
for ($count = 1; $count <= $product_upsell; $count++) { ?>
<li class="item">
<?php include('inc/inc-product.php') ?>
</li>
<?php } ?>
</ul>
</div>
</aside><!-- #products-upsell -->
</div>
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
jQuery(function($cart) {
$cart('.js-update-quantity').on('change', function(e) {
var newQuantity = $cart(this).val();
$cart(this).parent().submit();
})
});
</script>
{/block}

View File

@@ -94,7 +94,7 @@ URL: http://www.thelia.net
<li><a href="{url path="/login"}" class="login">{intl l="Log In!"}</a></li>
{/elseloop}
<li class="dropdown">
<a href="cart.html" class="dropdown-toggle cart" data-toggle="dropdown">
<a href="{url path="/cart"}" class="dropdown-toggle cart" data-toggle="dropdown">
Cart <span class="badge">{cart attr="count_item"}</span>
</a>
</li>

View File

@@ -0,0 +1,177 @@
{extends file="layout.tpl"}
{block name="breadcrumb"}
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">You are here: </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{navigate to="index"}" itemprop="url"><span itemprop="title">Home</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{url path="/cart"}" itemprop="url"><span itemprop="title">Cart</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">Billing and delivery</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
{/block}
{block name="main-content"}
<div class="main">
<article id="cart" class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">Your Cart</h1>
<div class="btn-group checkout-progress">
<a href="{url path="/cart"}" role="button" class="btn btn-step"><span class="step-nb">1</span> <span class="step-label">Your Cart</span></a>
<a href="#" role="button" class="btn btn-step active"><span class="step-nb">2</span> <span class="step-label">Billing and delivery</span></a>
<a href="#" role="button" class="btn btn-step disabled"><span class="step-nb">3</span> <span class="step-label">Check my order</span></a>
<a href="#" role="button" class="btn btn-step disabled"><span class="step-nb">4</span> <span class="step-label">Secure payment</span></a>
</div>
{form name="thelia.order.delivery"}
<form id="form-cart-delivery" action="{url path="/order/delivery"}" method="post" role="form" {form_enctype form=$form}>
{form_hidden_fields form=$form}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field form=$form field='delivery-address'}
<div id="delivery-address" class="panel">
<div class="panel-heading clearfix">
<a href="{url path="/address/create"}" class="btn btn-add-address">Add a new address</a>
Chose your delivery address
{if $error}
<span class="help-block"><span class="icon-remove"></span> {$message}</span>
{/if}
</div>
<div class="panel-body">
<table class="table table-address" role="presentation" summary="Address Books">
<tbody>
{loop type="address" name="customer.addresses" customer="current"}
<tr>
<th>
<div class="radio">
<label for="delivery-address_{$ID}">
<input type="radio" name="{$name}" value="{$ID}" {if $value == $ID}checked="checked"{/if} id="delivery-address_{$ID}">
{$LABEL}
</label>
</div>
</th>
<td>
<ul class="list-address">
<li>
<span class="fn">{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$LASTNAME|upper} {$FIRSTNAME|ucwords}</span>
<span class="org">{$COMPANY}</span>
</li>
<li>
<address class="adr">
<span class="street-address">{$ADDRESS1}</span>
{if $ADDRESS2 != ""}
<br><span class="street-address">{$ADDRESS2}</span>
{/if}
{if $ADDRESS3 != ""}
<br><span class="street-address">{$ADDRESS3}</span>
{/if}
<br><span class="postal-code">{$ZIPCODE}</span>
<span class="locality">{$CITY}, <span class="country-name">{loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}</span></span>
</address>
</li>
<li>
{if $CELLPHONE != ""}
<span class="tel">{$CELLPHONE}</span>
{/if}
{if $PHONE != ""}
<br><span class="tel">{$PHONE}</span>
{/if}
</li>
</ul>
</td>
<td>
<div class="group-btn">
<a href="{url path="/address/update/{$ID}"}" class="btn btn-edit-address" data-toggle="tooltip" title="Edit this address"><i class="icon-pencil"></i> <span>{intl l="Edit"}</span></a>
{if $DEFAULT != 1}
<a href="{url path="/address/delete/{$ID}"}" class="btn btn-remove-address js-remove-address" title="{intl l="Remove this address"}" data-toggle="tooltip"><i class="icon-remove"></i> <span>{intl l="Cancel"}</span></a>
{/if}
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
{/form_field}
{form_field form=$form field='delivery-module'}
<div id="delivery-method" class="panel">
<div class="panel-heading">
Choose your delivery method
{if $error}
<span class="help-block"><span class="icon-remove"></span> {$message}</span>
{/if}
</div>
<div class="panel-body">
{loop type="delivery" name="deliveries" force_return="true"}
<div class="radio">
<label for="delivery-method_1">
{form_field form=$form field='delivery-module'}
<input type="radio" name="{$name}" {if $value == $ID}checked="checked"{/if} value="{$ID}">
{/form_field}
<strong>{$TITLE}</strong> / {currency attr="symbol"} {$PRICE}
</label>
</div>
{/loop}
</div>
</div>
{/form_field}
<a href="{url path="/cart"}" role="button" class="btn btn-back"><span>Back</span></a>
<button type="submit" class="btn btn-checkout-next"><span>Next Step</span></button>
</form>
{/form}
</article>
</div>
<div class="modal fade" id="address-delete-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{intl l="Delete address"}</h3>
</div>
<div class="modal-body">
{intl l="Do you really want to delete this address ?"}
</div>
<div class="modal-footer">
<a href="#" type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</a>
<a href="#" id="address-delete-link" type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</a>
</div>
</div>
</div>
</div>
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
jQuery(function($cart) {
$cart(".js-remove-address").click(function(e){
e.preventDefault();
$cart("#address-delete-link").attr("href", $cart(this).attr("href"));
$cart('#address-delete-modal').modal('show');
})
});
</script>
{/block}

View File

@@ -0,0 +1,203 @@
{extends file="layout.tpl"}
{block name="breadcrumb"}
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">You are here: </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{navigate to="index"}" itemprop="url"><span itemprop="title">Home</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{url path="/cart"}" itemprop="url"><span itemprop="title">Cart</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">My order</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
{/block}
{block name="main-content"}
<div class="main">
<article class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">Your Cart</h1>
<div class="btn-group checkout-progress">
<a href="cart.php" role="button" class="btn btn-step"><span class="step-nb">1</span> <span class="step-label"> <span>Your Cart</span></a>
<a href="cart-step2.php" role="button" class="btn btn-step"><span class="step-nb">2</span> <span class="step-label">Billing and delivery</span></a>
<a href="cart-step3.php" role="button" class="btn btn-step active"><span class="step-nb">3</span> <span class="step-label">Check my order</span></a>
<a href="cart-step4.php" role="button" class="btn btn-step disabled"><span class="step-nb">4</span> <span class="step-label">Secure payment</span></a>
</div>
<form id="form-cart" action="cart-step4.php" method="post" role="form">
<table class="table table-cart">
<colgroup>
<col width="150">
<col>
<col width="200">
<col width="250">
</colgroup>
<thead>
<tr>
<th class="image">&nbsp;</th>
<th class="product">
<span class="hidden-xs">Product Name</span>
<span class="visible-xs">Name</span>
</th>
<th class="unitprice">
<span class="hidden-xs">Unit Price</span>
<span class="visible-xs">Price</span>
</th>
<th class="subprice">
<span class="hidden-xs">Total <abbr title="Tax Inclusive">TTC</abbr></span>
<span class="visible-xs">Total</span>
</th>
</tr>
</thead>
<tbody>
{loop type="cart" name="cartloop"}
<tr>
<td class="image">
<a href="{$PRODUCT_URL}" class="thumbnail">
{assign "cart_count" $LOOP_COUNT}
{ifloop rel='product-image'}
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="85" force_return="true"}
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}"></a>
{/loop}
{/ifloop}
{elseloop rel="product-image"}
{images file='assets/img/product/1/118x85.png'}<img itemprop="image" src="{$asset_url}" alt="Product #{$cart_count}">{/images}
{/elseloop}
</td>
<td class="product" >
<h3 class="name">
Product #{$cart_count}
</h3>
<div class="product-options">
<dl class="dl-horizontal">
<dt>Available :</dt>
<dd>In Stock</dd>
<dt>No.</dt>
<dd>{$REF}</dd>
{*<dt>Select Size</dt>
<dd>Large</dd>
<dt>Select Delivery Date</dt>
<dd>Jan 2, 2013</dd>
<dt>Additional Option</dt>
<dd>Option 1</dd>*}
</dl>
</div>
</td>
<td class="unitprice">
{if $IS_PROMO == 1}
{assign "real_price" $PROMO_TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$PROMO_TAXED_PRICE}</span></div>
<small class="old-price">instead of <span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></small>
{else}
{assign "real_price" $TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></div>
{/if}
</td>
<td class="subprice">
<span class="price">{currency attr="symbol"} {$real_price * $QUANTITY}</span>
</td>
</tr>
{/loop}
</tbody>
<tfoot>
<tr >
<td rowspan="3" colspan="2" class="empty">&nbsp;</td>
<th class="shipping">Shipping Tax</th>
<td class="shipping">
<div class="shipping-price">
<span class="price">{order attr="postage"}</span>
</div>
</td>
</tr>
<tr >
<th class="coupon"><label for="coupon">Enter your coupon code if you have one</label></th>
<td class="coupon">
<div class="input-group">
<input type="text" name="coupon" id="coupon" class="form-control">
<span class="input-group-btn">
<button type="button" class="btn btn-coupon">Ok</button>
</span>
</div><!-- /input-group -->
</td>
</tr>
<tr >
<th class="total">Total <abbr title="Tax Inclusive">TTC</abbr></th>
<td class="total">
<div class="total-price">
<span class="price">$200.00</span>
</div>
</td>
</tr>
</tfoot>
</table>
<div id="cart-address">
<div class="panel">
<div class="panel-heading">Delivery address</div>
<div class="panel-body">
<span class="fn">M. DUPONT Jean</span>
<span class="org">Agency XY</span>
<address class="adr">
<span class="street-address">street name of my business</span><br>
<span class="postal-code">75000</span>
<span class="locality">City, <span class="country-name">Country</span></span>
</address>
</div>
</div>
<div class="panel">
<div class="panel-heading">Billing address</div>
<div class="panel-body">
<span class="fn">M. DUPONT Jean</span>
<span class="org">Agency XY</span>
<address class="adr">
<span class="street-address">street name of my business</span><br>
<span class="postal-code">75000</span>
<span class="locality">City, <span class="country-name">Country</span></span>
</address>
<a href="address.php" class="btn btn-change-address">Change address</a>
</div>
</div>
</div>
<div id="payment-method" class="panel">
<div class="panel-heading">Choose your payment method</div>
<div class="panel-body">
<ul class="list-payment">
<?php foreach ($payment as $key => $value) { ?>
<li>
<div class="radio">
<label for="payment_<?php echo $key; ?>">
<input type="radio" name="payment" id="payment_<?php echo $key; ?>" value="<?php echo $value; ?>">
<img src="img/payment/<?php echo $value; ?>.png">
</label>
</div>
</li>
<?php } ?>
</div>
</div>
<a href="cart-step2.php" role="button" class="btn btn-back"><span>Back</span></a>
<button type="submit" class="btn btn-checkout-next"><span>Next Step</span></button>
</form>
</article>
</div>
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
jQuery(function($cart) {
});
</script>
{/block}

View File

@@ -94,13 +94,13 @@
online_only : http://schema.org/OnlineOnly
-->
{if $IS_PROMO }
{loop name="productSaleElements_promo" type="product_sale_elements" product="{$ID}" limit="1"}
{loop name="productSaleElements_promo" type="product_sale_elements" product="{$ID}" limit="1" order="min_price"}
{assign var="default_product_sale_elements" value="$ID"}
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number="{$TAXED_PROMO_PRICE}"} {currency attr="symbol"}</span></span>
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span class="price">{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}</span></span>
{/loop}
{else}
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number="{$BEST_TAXED_PRICE}"} {currency attr="symbol"}</span></span>
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}</span></span>
{/if}
</div>
</div>