Revert "Revert "Merge branch 'cleanmaster' into modules""

This reverts commit b3ac365b45.

Conflicts:
	Readme.md
	core/lib/Thelia/Controller/Admin/AbstractCrudController.php
	core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php
	core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php
	core/lib/Thelia/Core/Template/Smarty/SmartyParser.php
	core/lib/Thelia/Core/Template/TemplateDefinition.php
	core/lib/Thelia/Model/Base/Coupon.php
	core/lib/Thelia/Model/Base/CouponQuery.php
	core/lib/Thelia/Model/Base/CouponVersion.php
	core/lib/Thelia/Model/Base/CouponVersionQuery.php
	core/lib/Thelia/Model/Base/OrderCouponQuery.php
This commit is contained in:
Etienne Roudeix
2014-01-06 11:25:25 +01:00
parent d4582f467f
commit 99038e688a
327 changed files with 3728 additions and 3732 deletions

View File

@@ -63,6 +63,7 @@ Thelia documentation is available at http://doc.thelia.net
The documentation is also in beta version and some part can be obsolete cause to some refactor. The documentation is also in beta version and some part can be obsolete cause to some refactor.
Contribute Contribute
---------- ----------

View File

@@ -30,7 +30,6 @@ use Thelia\Core\Event\UpdateSeoEvent;
use Thelia\Exception\UrlRewritingException; use Thelia\Exception\UrlRewritingException;
use Thelia\Form\Exception\FormValidationException; use Thelia\Form\Exception\FormValidationException;
use \Thelia\Model\Tools\UrlRewritingTrait;
class BaseAction class BaseAction
{ {

View File

@@ -28,6 +28,7 @@ use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\Event\Coupon\CouponConsumeEvent; use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent; use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;
use Thelia\Coupon\CouponFactory; use Thelia\Coupon\CouponFactory;
@@ -36,6 +37,7 @@ use Thelia\Condition\ConditionCollection;
use Thelia\Coupon\Type\CouponInterface; use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as CouponModel; use Thelia\Model\Coupon as CouponModel;
use Thelia\Model\CouponQuery; use Thelia\Model\CouponQuery;
use Thelia\Model\OrderCoupon;
/** /**
* Process Coupon Events * Process Coupon Events
@@ -118,23 +120,20 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$request->getSession()->setConsumedCoupons($consumedCoupons); $request->getSession()->setConsumedCoupons($consumedCoupons);
$totalDiscount = $couponManager->getDiscount(); $totalDiscount = $couponManager->getDiscount();
// @todo insert false product in cart with the name of the coupon and the discount as negative price
// Decrement coupon quantity
// @todo move this part in after order event
$couponQuery = CouponQuery::create();
$couponModel = $couponQuery->findOneByCode($coupon->getCode());
$couponManager->decrementQuantity($couponModel);
$request $request
->getSession() ->getSession()
->getCart() ->getCart()
->setDiscount($totalDiscount) ->setDiscount($totalDiscount)
->save(); ->save();
$request
->getSession()
->getOrder()
->setDiscount($totalDiscount)
->save();
} }
} }
$event->setIsValid($isValid); $event->setIsValid($isValid);
$event->setDiscount($totalDiscount); $event->setDiscount($totalDiscount);
} }
@@ -203,6 +202,68 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$event->setCouponModel($coupon); $event->setCouponModel($coupon);
} }
/**
* @param \Thelia\Core\Event\Order\OrderEvent $event
*/
public function testFreePostage(OrderEvent $event)
{
/** @var CouponManager $couponManager */
$couponManager = $this->container->get('thelia.coupon.manager');
if($couponManager->isCouponRemovingPostage()) {
$order = $event->getOrder();
$order->setPostage(0);
$event->setOrder($order);
$event->stopPropagation();
}
}
/**
* @param \Thelia\Core\Event\Order\OrderEvent $event
*/
public function afterOrder(OrderEvent $event)
{
$request = $this->container->get('request');
/** @var CouponManager $couponManager */
$couponManager = $this->container->get('thelia.coupon.manager');
$consumedCoupons = $request->getSession()->getConsumedCoupons();
if (is_array($consumedCoupons)) {
foreach($consumedCoupons as $couponCode) {
$couponQuery = CouponQuery::create();
$couponModel = $couponQuery->findOneByCode($couponCode);
$couponModel->setLocale($request->getSession()->getLang()->getLocale());
/* decrease coupon quantity */
$couponManager->decrementQuantity($couponModel);
/* memorize coupon */
$orderCoupon = new OrderCoupon();
$orderCoupon->setOrder($event->getOrder())
->setCode($couponModel->getCode())
->setType($couponModel->getType())
->setAmount($couponModel->getAmount())
->setTitle($couponModel->getTitle())
->setShortDescription($couponModel->getShortDescription())
->setDescription($couponModel->getDescription())
->setExpirationDate($couponModel->getExpirationDate())
->setIsCumulative($couponModel->getIsCumulative())
->setIsRemovingPostage($couponModel->getIsRemovingPostage())
->setIsAvailableOnSpecialOffers($couponModel->getIsAvailableOnSpecialOffers())
->setSerializedConditions($couponModel->getSerializedConditions())
;
$orderCoupon->save();
}
}
}
/** /**
* Returns an array of event names this subscriber listens to. * Returns an array of event names this subscriber listens to.
* *
@@ -229,7 +290,9 @@ class Coupon extends BaseAction implements EventSubscriberInterface
TheliaEvents::COUPON_CREATE => array("create", 128), TheliaEvents::COUPON_CREATE => array("create", 128),
TheliaEvents::COUPON_UPDATE => array("update", 128), TheliaEvents::COUPON_UPDATE => array("update", 128),
TheliaEvents::COUPON_CONSUME => array("consume", 128), TheliaEvents::COUPON_CONSUME => array("consume", 128),
TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128) TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128),
TheliaEvents::ORDER_SET_POSTAGE => array("testFreePostage", 256),
TheliaEvents::ORDER_BEFORE_PAYMENT => array("afterOrder", 128),
); );
} }
} }

View File

@@ -30,6 +30,7 @@ use Thelia\Core\Event\Cart\CartEvent;
use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Coupon\CouponManager;
use Thelia\Exception\TheliaProcessException; use Thelia\Exception\TheliaProcessException;
use Thelia\Model\AddressQuery; use Thelia\Model\AddressQuery;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
@@ -73,6 +74,17 @@ class Order extends BaseAction implements EventSubscriberInterface
$order = $event->getOrder(); $order = $event->getOrder();
$order->setDeliveryModuleId($event->getDeliveryModule()); $order->setDeliveryModuleId($event->getDeliveryModule());
$event->setOrder($order);
}
/**
* @param \Thelia\Core\Event\Order\OrderEvent $event
*/
public function setPostage(OrderEvent $event)
{
$order = $event->getOrder();
$order->setPostage($event->getPostage()); $order->setPostage($event->getPostage());
$event->setOrder($order); $event->setOrder($order);
@@ -178,6 +190,11 @@ class Order extends BaseAction implements EventSubscriberInterface
OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID)->getId() OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID)->getId()
); );
/* memorize discount */
$placedOrder->setDiscount(
$cart->getDiscount()
);
$placedOrder->save($con); $placedOrder->save($con);
/* fulfill order_products and decrease stock */ /* fulfill order_products and decrease stock */
@@ -262,8 +279,6 @@ class Order extends BaseAction implements EventSubscriberInterface
} }
} }
/* discount @todo */
$con->commit(); $con->commit();
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_BEFORE_PAYMENT, new OrderEvent($placedOrder)); $this->getDispatcher()->dispatch(TheliaEvents::ORDER_BEFORE_PAYMENT, new OrderEvent($placedOrder));
@@ -273,7 +288,7 @@ class Order extends BaseAction implements EventSubscriberInterface
$sessionOrder = new \Thelia\Model\Order(); $sessionOrder = new \Thelia\Model\Order();
$event->setOrder($sessionOrder); $event->setOrder($sessionOrder);
$event->setPlacedOrder($placedOrder); $event->setPlacedOrder($placedOrder);
$this->getSession()->setOrder($sessionOrder); $this->getSession()->setOrder($placedOrder);
/* empty cart */ /* empty cart */
$this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest()))); $this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest())));
@@ -412,6 +427,7 @@ class Order extends BaseAction implements EventSubscriberInterface
return array( return array(
TheliaEvents::ORDER_SET_DELIVERY_ADDRESS => array("setDeliveryAddress", 128), TheliaEvents::ORDER_SET_DELIVERY_ADDRESS => array("setDeliveryAddress", 128),
TheliaEvents::ORDER_SET_DELIVERY_MODULE => array("setDeliveryModule", 128), TheliaEvents::ORDER_SET_DELIVERY_MODULE => array("setDeliveryModule", 128),
TheliaEvents::ORDER_SET_POSTAGE => array("setPostage", 128),
TheliaEvents::ORDER_SET_INVOICE_ADDRESS => array("setInvoiceAddress", 128), TheliaEvents::ORDER_SET_INVOICE_ADDRESS => array("setInvoiceAddress", 128),
TheliaEvents::ORDER_SET_PAYMENT_MODULE => array("setPaymentModule", 128), TheliaEvents::ORDER_SET_PAYMENT_MODULE => array("setPaymentModule", 128),
TheliaEvents::ORDER_PAY => array("create", 128), TheliaEvents::ORDER_PAY => array("create", 128),

View File

@@ -131,7 +131,6 @@ class Product extends BaseAction implements EventSubscriberInterface
return $this->genericUpdateSeo(ProductQuery::create(), $event); return $this->genericUpdateSeo(ProductQuery::create(), $event);
} }
/** /**
* Delete a product entry * Delete a product entry
* *

View File

@@ -209,8 +209,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
if ($product->countSaleElements() <= 0) { if ($product->countSaleElements() <= 0) {
// If we just deleted the last PSE, create a default one // If we just deleted the last PSE, create a default one
$product->createProductSaleElement($con, 0, 0, 0, $event->getCurrencyId(), true); $product->createProductSaleElement($con, 0, 0, 0, $event->getCurrencyId(), true);
} } elseif ($pse->getIsDefault()) {
elseif ($pse->getIsDefault()) {
// If we deleted the default PSE, make the last created one the default // If we deleted the default PSE, make the last created one the default
$pse = ProductSaleElementsQuery::create() $pse = ProductSaleElementsQuery::create()
@@ -238,8 +237,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
* *
* @param ProductCombinationGenerationEvent $event * @param ProductCombinationGenerationEvent $event
*/ */
public function generateCombinations(ProductCombinationGenerationEvent $event) { public function generateCombinations(ProductCombinationGenerationEvent $event)
{
$con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME); $con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
$con->beginTransaction(); $con->beginTransaction();
@@ -276,8 +275,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
// Store all the stuff ! // Store all the stuff !
$con->commit(); $con->commit();
} } catch (\Exception $ex) {
catch (\Exception $ex) {
$con->rollback(); $con->rollback();

View File

@@ -32,7 +32,6 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
use Thelia\Tools\Password; use Thelia\Tools\Password;
/** /**
* command line for updating admin password * command line for updating admin password
* *
@@ -72,18 +71,15 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand
{ {
$login = $input->getArgument('login'); $login = $input->getArgument('login');
if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) { if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) {
throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login)); throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login));
} }
$password = $input->getOption('password') ?: Password::generateRandom(); $password = $input->getOption('password') ?: Password::generateRandom();
$event = new AdministratorUpdatePasswordEvent($admin); $event = new AdministratorUpdatePasswordEvent($admin);
$event->setPassword($password); $event->setPassword($password);
$this-> $this->
getContainer() getContainer()
->get('event_dispatcher') ->get('event_dispatcher')
@@ -99,4 +95,3 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand
} }
} }

View File

@@ -28,6 +28,7 @@
<loop class="Thelia\Core\Template\Loop\Order" name="order"/> <loop class="Thelia\Core\Template\Loop\Order" name="order"/>
<loop class="Thelia\Core\Template\Loop\OrderAddress" name="order_address"/> <loop class="Thelia\Core\Template\Loop\OrderAddress" name="order_address"/>
<loop class="Thelia\Core\Template\Loop\OrderProduct" name="order_product"/> <loop class="Thelia\Core\Template\Loop\OrderProduct" name="order_product"/>
<loop class="Thelia\Core\Template\Loop\OrderCoupon" name="order_coupon"/>
<loop class="Thelia\Core\Template\Loop\OrderProductAttributeCombination" name="order_product_attribute_combination"/> <loop class="Thelia\Core\Template\Loop\OrderProductAttributeCombination" name="order_product_attribute_combination"/>
<loop class="Thelia\Core\Template\Loop\OrderStatus" name="order-status"/> <loop class="Thelia\Core\Template\Loop\OrderStatus" name="order-status"/>
<loop class="Thelia\Core\Template\Loop\CategoryPath" name="category-path"/> <loop class="Thelia\Core\Template\Loop\CategoryPath" name="category-path"/>

View File

@@ -443,7 +443,6 @@ abstract class AbstractCrudController extends BaseAdminController
$ex $ex
); );
return $this->renderEditionTemplate(); return $this->renderEditionTemplate();
} }

View File

@@ -134,7 +134,8 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
* *
* @param unknown $object * @param unknown $object
*/ */
protected function hydrateSeoForm($object){ protected function hydrateSeoForm($object)
{
// The "SEO" tab form // The "SEO" tab form
$locale = $object->getLocale(); $locale = $object->getLocale();
$data = array( $data = array(
@@ -227,8 +228,6 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
$ex $ex
); );
// At this point, the form has errors, and should be redisplayed. // At this point, the form has errors, and should be redisplayed.
return $this->renderEditionTemplate(); return $this->renderEditionTemplate();
} }

View File

@@ -309,7 +309,8 @@ class AddressController extends AbstractCrudController
$this->redirectToEditionTemplate(); $this->redirectToEditionTemplate();
} }
protected function getCustomerId() { protected function getCustomerId()
{
if (null !== $address = $this->getExistingObject()) if (null !== $address = $this->getExistingObject())
return $address->getCustomerId(); return $address->getCustomerId();
else else

View File

@@ -34,7 +34,6 @@ use Thelia\Form\AttributeModificationForm;
use Thelia\Form\AttributeCreationForm; use Thelia\Form\AttributeCreationForm;
use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\AttributeAv; use Thelia\Model\AttributeAv;
use Thelia\Model\AttributeAvQuery;
use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent; use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent;
use Thelia\Core\Event\Attribute\AttributeEvent; use Thelia\Core\Event\Attribute\AttributeEvent;

View File

@@ -309,6 +309,7 @@ class BaseAdminController extends BaseController
{ {
// Check if the functionality is activated // Check if the functionality is activated
if(!ConfigQuery::read("one_domain_foreach_lang", false)) if(!ConfigQuery::read("one_domain_foreach_lang", false))
return; return;
// If we don't have a locale value, use the locale value in the session // If we don't have a locale value, use the locale value in the session

View File

@@ -201,15 +201,12 @@ class CategoryController extends AbstractSeoCrudController
protected function redirectToListTemplateWithId($category_id) protected function redirectToListTemplateWithId($category_id)
{ {
if($category_id > 0) if ($category_id > 0) {
{
$this->redirectToRoute( $this->redirectToRoute(
'admin.categories.default', 'admin.categories.default',
array('category_id' => $category_id) array('category_id' => $category_id)
); );
} } else {
else
{
$this->redirectToRoute( $this->redirectToRoute(
'admin.catalog' 'admin.catalog'
); );

View File

@@ -23,11 +23,9 @@
namespace Thelia\Controller\Admin; namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Form\ConfigStoreForm; use Thelia\Form\ConfigStoreForm;
use Thelia\Log\Tlog;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
/** /**
* Class ConfigStoreController * Class ConfigStoreController

View File

@@ -23,19 +23,14 @@
namespace Thelia\Controller\Admin; namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent; use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\AccessManager;
use Thelia\Form\CustomerCreateForm; use Thelia\Form\CustomerCreateForm;
use Thelia\Form\CustomerUpdateForm; use Thelia\Form\CustomerUpdateForm;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\CustomerQuery; use Thelia\Model\CustomerQuery;
use Thelia\Core\Translation\Translator;
use Thelia\Tools\Password; use Thelia\Tools\Password;
use Thelia\Model\AddressQuery;
use Thelia\Model\Address; use Thelia\Model\Address;
/** /**

View File

@@ -34,7 +34,6 @@ use Thelia\Form\FeatureModificationForm;
use Thelia\Form\FeatureCreationForm; use Thelia\Form\FeatureCreationForm;
use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Model\FeatureAv; use Thelia\Model\FeatureAv;
use Thelia\Model\FeatureAvQuery;
use Thelia\Core\Event\Feature\FeatureAvUpdateEvent; use Thelia\Core\Event\Feature\FeatureAvUpdateEvent;
use Thelia\Core\Event\Feature\FeatureEvent; use Thelia\Core\Event\Feature\FeatureEvent;

View File

@@ -88,7 +88,6 @@ class HomeController extends BaseAdminController
array(5) array(5)
); );
$data->series = array( $data->series = array(
$saleSeries, $saleSeries,
$newCustomerSeries, $newCustomerSeries,

View File

@@ -31,7 +31,6 @@ use Thelia\Model\MessageQuery;
use Thelia\Form\MessageModificationForm; use Thelia\Form\MessageModificationForm;
use Thelia\Form\MessageCreationForm; use Thelia\Form\MessageCreationForm;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
/** /**
@@ -164,8 +163,8 @@ class MessageController extends AbstractCrudController
return $this->render('messages'); return $this->render('messages');
} }
protected function listDirectoryContent($requiredExtension) { protected function listDirectoryContent($requiredExtension)
{
$list = array(); $list = array();
$dir = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath(); $dir = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath();

View File

@@ -149,7 +149,6 @@ class ModuleController extends AbstractCrudController
->findOneById($this->getRequest()->get('module_id')); ->findOneById($this->getRequest()->get('module_id'));
} }
protected function getObjectLabel($object) protected function getObjectLabel($object)
{ {
return $object->getTitle(); return $object->getTitle();
@@ -223,7 +222,6 @@ class ModuleController extends AbstractCrudController
} }
if (null !== $response = $this->checkAuth(array(), $module_code, AccessManager::VIEW)) return $response; if (null !== $response = $this->checkAuth(array(), $module_code, AccessManager::VIEW)) return $response;
return $this->render( return $this->render(
"module-configure", "module-configure",
array( array(

View File

@@ -27,7 +27,6 @@ use Thelia\Core\HttpFoundation\Response;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\PdfEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Form\OrderUpdateAddress; use Thelia\Form\OrderUpdateAddress;
@@ -36,7 +35,6 @@ use Thelia\Model\Base\OrderAddressQuery;
use Thelia\Model\OrderQuery; use Thelia\Model\OrderQuery;
use Thelia\Model\OrderStatusQuery; use Thelia\Model\OrderStatusQuery;
use Thelia\Tools\URL; use Thelia\Tools\URL;
use Thelia\Core\Template\TemplateHelper;
/** /**
* Class OrderController * Class OrderController
@@ -203,14 +201,12 @@ class OrderController extends BaseAdminController
public function generateInvoicePdf($order_id) public function generateInvoicePdf($order_id)
{ {
if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response;
return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice')); return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice'));
} }
public function generateDeliveryPdf($order_id) public function generateDeliveryPdf($order_id)
{ {
if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response;
return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery')); return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery'));
} }
@@ -225,5 +221,4 @@ class OrderController extends BaseAdminController
return $response; return $response;
} }
} }

View File

@@ -72,7 +72,6 @@ use Thelia\Form\ProductCombinationGenerationForm;
use Thelia\TaxEngine\Calculator; use Thelia\TaxEngine\Calculator;
use Thelia\Tools\NumberFormat; use Thelia\Tools\NumberFormat;
/** /**
* Manages products * Manages products
* *
@@ -1037,7 +1036,8 @@ class ProductController extends AbstractSeoCrudController
} }
// Create combinations // Create combinations
protected function combine($input, &$output, &$tmp) { protected function combine($input, &$output, &$tmp)
{
$current = array_shift($input); $current = array_shift($input);
if (count($input) > 0) { if (count($input) > 0) {
@@ -1058,8 +1058,8 @@ class ProductController extends AbstractSeoCrudController
/** /**
* Build combinations from the combination output builder * Build combinations from the combination output builder
*/ */
public function buildCombinationsAction() { public function buildCombinationsAction()
{
// Check current user authorization // Check current user authorization
if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response; if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Controller\Admin; namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Form\SystemLogConfigurationForm; use Thelia\Form\SystemLogConfigurationForm;
@@ -58,8 +57,8 @@ class SystemLogController extends BaseAdminController
); );
} }
protected function loadDefinedDestinations($directory, &$destinations) { protected function loadDefinedDestinations($directory, &$destinations)
{
try { try {
foreach (new \DirectoryIterator($directory) as $fileInfo) { foreach (new \DirectoryIterator($directory) as $fileInfo) {

View File

@@ -23,12 +23,8 @@
namespace Thelia\Controller\Admin; namespace Thelia\Controller\Admin;
use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Core\Security\AccessManager; use Thelia\Core\Security\AccessManager;
use Thelia\Form\SystemLogConfigurationForm;
use Thelia\Log\Tlog;
use Thelia\Model\ConfigQuery;
use Thelia\Model\ModuleQuery; use Thelia\Model\ModuleQuery;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\Template\TemplateDefinition;
@@ -149,8 +145,7 @@ class TranslationsController extends BaseAdminController
$templateArguments['max_input_vars_warning'] = true; $templateArguments['max_input_vars_warning'] = true;
$templateArguments['required_max_input_vars'] = $stringsCount; $templateArguments['required_max_input_vars'] = $stringsCount;
$templateArguments['current_max_input_vars'] = ini_get('max_input_vars'); $templateArguments['current_max_input_vars'] = ini_get('max_input_vars');
} } else {
else {
$templateArguments['all_strings'] = $all_strings; $templateArguments['all_strings'] = $all_strings;
} }
} }
@@ -162,14 +157,12 @@ class TranslationsController extends BaseAdminController
public function defaultAction() public function defaultAction()
{ {
if (null !== $response = $this->checkAuth(AdminResources::TRANSLATIONS, array(), AccessManager::VIEW)) return $response; if (null !== $response = $this->checkAuth(AdminResources::TRANSLATIONS, array(), AccessManager::VIEW)) return $response;
return $this->renderTemplate(); return $this->renderTemplate();
} }
public function updateAction() public function updateAction()
{ {
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response; if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response;
return $this->renderTemplate(); return $this->renderTemplate();
} }
} }

View File

@@ -252,7 +252,6 @@ abstract class BaseController extends ContainerAware
} }
} }
/** /**

View File

@@ -25,10 +25,8 @@ namespace Thelia\Controller\Front;
use Symfony\Component\Routing\Router; use Symfony\Component\Routing\Router;
use Thelia\Controller\BaseController; use Thelia\Controller\BaseController;
use Thelia\Core\HttpFoundation\Response; use Thelia\Core\HttpFoundation\Response;
use Thelia\Core\Security\Exception\AuthenticationException;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
use Thelia\Model\AddressQuery; use Thelia\Model\AddressQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Model\ModuleQuery; use Thelia\Model\ModuleQuery;
use Thelia\Tools\Redirect; use Thelia\Tools\Redirect;
use Thelia\Tools\URL; use Thelia\Tools\URL;

View File

@@ -26,7 +26,6 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
/** /**
* Class TranslatorPass * Class TranslatorPass
* @package Thelia\Core\DependencyInjection\Compiler * @package Thelia\Core\DependencyInjection\Compiler

View File

@@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Administrator;
use Thelia\Core\Event\ActionEvent; use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Admin; use Thelia\Model\Admin;
/** /**
* Class AdministratorUpdatePasswordEvent * Class AdministratorUpdatePasswordEvent
* @package Thelia\Core\Event\Administrator * @package Thelia\Core\Event\Administrator
@@ -82,4 +81,3 @@ class AdministratorUpdatePasswordEvent extends ActionEvent
} }
} }

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Customer; namespace Thelia\Core\Event\Customer;
use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\Event;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Customer; use Thelia\Model\Customer;
/** /**

View File

@@ -23,7 +23,6 @@
namespace Thelia\Core\Event\Customer; namespace Thelia\Core\Event\Customer;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Customer; use Thelia\Model\Customer;
class CustomerLoginEvent extends CustomerEvent class CustomerLoginEvent extends CustomerEvent

View File

@@ -65,6 +65,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setReference($reference) public function setReference($reference)
{ {
$this->reference = $reference; $this->reference = $reference;
return $this; return $this;
} }
@@ -76,6 +77,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setPrice($price) public function setPrice($price)
{ {
$this->price = $price; $this->price = $price;
return $this; return $this;
} }
@@ -87,6 +89,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setWeight($weight) public function setWeight($weight)
{ {
$this->weight = $weight; $this->weight = $weight;
return $this; return $this;
} }
@@ -98,6 +101,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setQuantity($quantity) public function setQuantity($quantity)
{ {
$this->quantity = $quantity; $this->quantity = $quantity;
return $this; return $this;
} }
@@ -109,6 +113,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setSalePrice($sale_price) public function setSalePrice($sale_price)
{ {
$this->sale_price = $sale_price; $this->sale_price = $sale_price;
return $this; return $this;
} }
@@ -120,6 +125,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setOnsale($onsale) public function setOnsale($onsale)
{ {
$this->onsale = $onsale; $this->onsale = $onsale;
return $this; return $this;
} }
@@ -131,6 +137,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setIsnew($isnew) public function setIsnew($isnew)
{ {
$this->isnew = $isnew; $this->isnew = $isnew;
return $this; return $this;
} }
@@ -142,6 +149,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setEanCode($ean_code) public function setEanCode($ean_code)
{ {
$this->ean_code = $ean_code; $this->ean_code = $ean_code;
return $this; return $this;
return $this; return $this;
} }
@@ -154,6 +162,7 @@ class ProductCombinationGenerationEvent extends ProductEvent
public function setCombinations($combinations) public function setCombinations($combinations)
{ {
$this->combinations = $combinations; $this->combinations = $combinations;
return $this; return $this;
} }
} }

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Core\Event\ProductSaleElement; namespace Thelia\Core\Event\ProductSaleElement;
use Thelia\Model\Product;
class ProductSaleElementDeleteEvent extends ProductSaleElementEvent class ProductSaleElementDeleteEvent extends ProductSaleElementEvent
{ {

View File

@@ -370,6 +370,7 @@ final class TheliaEvents
*/ */
const ORDER_SET_DELIVERY_ADDRESS = "action.order.setDeliveryAddress"; const ORDER_SET_DELIVERY_ADDRESS = "action.order.setDeliveryAddress";
const ORDER_SET_DELIVERY_MODULE = "action.order.setDeliveryModule"; const ORDER_SET_DELIVERY_MODULE = "action.order.setDeliveryModule";
const ORDER_SET_POSTAGE = "action.order.setPostage";
const ORDER_SET_INVOICE_ADDRESS = "action.order.setInvoiceAddress"; const ORDER_SET_INVOICE_ADDRESS = "action.order.setInvoiceAddress";
const ORDER_SET_PAYMENT_MODULE = "action.order.setPaymentModule"; const ORDER_SET_PAYMENT_MODULE = "action.order.setPaymentModule";
const ORDER_PAY = "action.order.pay"; const ORDER_PAY = "action.order.pay";

View File

@@ -184,5 +184,4 @@ class UpdateSeoEvent extends ActionEvent
return $this->object; return $this->object;
} }
} }

View File

@@ -30,12 +30,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Response; use Thelia\Core\HttpFoundation\Response;
use Symfony\Component\Routing\Router; use Symfony\Component\Routing\Router;
use Thelia\Core\HttpKernel\Exception\NotFountHttpException;
use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\ParserInterface;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
use Thelia\Exception\OrderException; use Thelia\Exception\OrderException;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\Redirect; use Thelia\Tools\Redirect;
use Thelia\Tools\URL; use Thelia\Tools\URL;
use Thelia\Core\Security\Exception\AuthenticationException; use Thelia\Core\Security\Exception\AuthenticationException;

View File

@@ -39,8 +39,8 @@ class Response extends BaseResponse
* *
* @see \Thelia\Core\HttpFoundation\Response::sendContent() * @see \Thelia\Core\HttpFoundation\Response::sendContent()
*/ */
public function sendContent() { public function sendContent()
{
Tlog::getInstance()->write($this->content); Tlog::getInstance()->write($this->content);
parent::sendContent(); parent::sendContent();

View File

@@ -65,6 +65,7 @@ class HttpCache extends BaseHttpCache implements HttpKernelInterface
$request->getContent() $request->getContent()
); );
} }
return parent::handle($request, $type, $catch); return parent::handle($request, $type, $catch);
} }

View File

@@ -23,45 +23,32 @@
namespace Thelia\Core\Template\Assets; namespace Thelia\Core\Template\Assets;
interface AssetManagerInterface { interface AssetManagerInterface
{
/** /**
* Prepare an asset directory by checking that no changes occured in * Prepare an asset directory.
* the source directory. If any change is detected, the whole asset directory
* is copied in the web space.
*
* @param string $sourceAssetsDirectory the full path to the source asstes directory
* @param string $webAssetsDirectoryBase the base directory of the web based asset directory
* @param $webAssetsTemplate
* @param string $webAssetsKey the assets key : module name or 0 for base template
* *
* @param string $source_assets_directory the full path to the source asstes directory
* @param string $web_assets_directory_base the base directory of the web based asset directory
* @throws \RuntimeException if something goes wrong. * @throws \RuntimeException if something goes wrong.
*
* @internal param string $source_assets_directory the full path to the source asstes directory
* @internal param string $web_assets_directory_base the base directory of the web based asset directory
* @internal param string $key the assets key : module name or 0 for base template
*/ */
public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey); public function prepareAssets($source_assets_directory, $web_assets_directory_base);
/** /**
* Generates assets from $asset_path in $output_path, using $filters. * Generates assets from $asset_path in $output_path, using $filters.
* *
* @param $assetSource * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less)
* @param $assetDirectoryBase
* @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less)
* *
* @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
* @param $webAssetsKey * @param string $output_url the URL to the base assets output directory in the web space
* @param string $outputUrl the URL to the base assets output directory in the web space
* *
* @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension.
* @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * @param array $filters a list of filters, as defined below (see switch($filter_name) ...)
* *
* @param boolean $debug true / false * @param boolean $debug the debug mode, true or false
*
* @internal param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
* @internal param string $output_url the URL to the base assets output directory in the web space
* *
* @throws \InvalidArgumentException if an invalid filter name is found
* @return string The URL to the generated asset file. * @return string The URL to the generated asset file.
*/ */
public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug); public function processAsset($asset_path, $web_assets_directory_base, $output_url, $asset_type, $filters, $debug);
} }

View File

@@ -31,6 +31,7 @@ use Assetic\AssetWriter;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Log\Tlog; use Thelia\Log\Tlog;
use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
/** /**
* This class is a simple helper for generating assets using Assetic. * This class is a simple helper for generating assets using Assetic.
@@ -72,19 +73,17 @@ class AsseticAssetManager implements AssetManagerInterface
/** /**
* Check if a file is a source asset file * Check if a file is a source asset file
* *
* @param \SplFileInfo $fileInfo * @param \DirectoryIterator $fileInfo
*
* @return bool
*/ */
protected function isSourceFile(\SplFileInfo $fileInfo) { protected function isSourceFile(\SplFileInfo $fileInfo)
{
return in_array($fileInfo->getExtension(), $this->source_file_extensions); return in_array($fileInfo->getExtension(), $this->source_file_extensions);
} }
/** /**
* Recursively copy assets from the source directory to the destination * Recursively copy assets from the source directory to the destination
* directory in the web space, omitting source files. * directory in the web space, ommiting source files.
* *
* @param Filesystem $fs
* @param string $from_directory the source * @param string $from_directory the source
* @param string $to_directory the destination * @param string $to_directory the destination
* @throws \RuntimeException if a problem occurs. * @throws \RuntimeException if a problem occurs.
@@ -123,21 +122,38 @@ class AsseticAssetManager implements AssetManagerInterface
} }
} }
/**
* Compite the assets path relative to the base template directory
*
* @param string $source_assets_directory the source directory
* @param string $web_assets_directory_base base directory of the web assets
* @return the full path of the destination directory
*/
protected function getRelativeDirectoryPath($source_assets_directory, $web_assets_directory_base)
{
$source_assets_directory = realpath($source_assets_directory);
// Remove base path from asset source path to get a path relative to the template base
// and use it to create the destination path.
return str_replace(
realpath(THELIA_ROOT),
'',
$source_assets_directory
);
}
/** /**
* Compute the destination directory path, from the source directory and the * Compute the destination directory path, from the source directory and the
* base directory of the web assets * base directory of the web assets
* *
* @param string $webAssetsDirectoryBase base directory of the web assets * @param string $source_assets_directory the source directory
* @param $webAssetsTemplate * @param string $web_assets_directory_base base directory of the web assets
* @param string $webAssetsKey the assests key : module name or 0 for base template
*
* @internal param string $source_assets_directory the source directory
* @return the full path of the destination directory * @return the full path of the destination directory
*/ */
protected function getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey) protected function getDestinationDirectory($source_assets_directory, $web_assets_directory_base)
{ {
// Compute the absolute path of the output directory // Compute the absolute path of the output directory
return $webAssetsDirectoryBase . DS . $webAssetsTemplate . DS . $webAssetsKey; return $web_assets_directory_base . $this->getRelativeDirectoryPath($source_assets_directory, $web_assets_directory_base);
} }
/** /**
@@ -145,17 +161,14 @@ class AsseticAssetManager implements AssetManagerInterface
* the source directory. If any change is detected, the whole asset directory * the source directory. If any change is detected, the whole asset directory
* is copied in the web space. * is copied in the web space.
* *
* @param string $sourceAssetsDirectory the full path to the source asstes directory * @param string $source_assets_directory the full path to the source asstes directory
* @param string $webAssetsDirectoryBase the base directory of the web based asset directory * @param string $web_assets_directory_base the base directory of the web based asset directory
* @param $webAssetsTemplate
* @param string $webAssetsKey the assets key : module name or 0 for base template
*
* @throws \RuntimeException if something goes wrong. * @throws \RuntimeException if something goes wrong.
*/ */
public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey) public function prepareAssets($source_assets_directory, $web_assets_directory_base)
{ {
// Compute the absolute path of the output directory // Compute the absolute path of the output directory
$to_directory = $this->getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey); $to_directory = $this->getDestinationDirectory($source_assets_directory, $web_assets_directory_base);
// Get a path to the stamp file // Get a path to the stamp file
$stamp_file_path = $to_directory . DS . '.source-stamp'; $stamp_file_path = $to_directory . DS . '.source-stamp';
@@ -164,7 +177,7 @@ class AsseticAssetManager implements AssetManagerInterface
$prev_stamp = @file_get_contents($stamp_file_path); $prev_stamp = @file_get_contents($stamp_file_path);
// Get the current stamp of the source directory // Get the current stamp of the source directory
$curr_stamp = $this->getStamp($sourceAssetsDirectory); $curr_stamp = $this->getStamp($source_assets_directory);
if ($prev_stamp !== $curr_stamp) { if ($prev_stamp !== $curr_stamp) {
@@ -185,7 +198,7 @@ class AsseticAssetManager implements AssetManagerInterface
$fs->remove($tmp_dir); $fs->remove($tmp_dir);
// Copy the whole source dir in a temp directory // Copy the whole source dir in a temp directory
$this->copyAssets($fs, $sourceAssetsDirectory, $tmp_dir); $this->copyAssets($fs, $source_assets_directory, $tmp_dir);
// Remove existing directory // Remove existing directory
if ($fs->exists($to_directory)) $fs->remove($to_directory); if ($fs->exists($to_directory)) $fs->remove($to_directory);
@@ -205,8 +218,7 @@ class AsseticAssetManager implements AssetManagerInterface
throw new \RuntimeException( throw new \RuntimeException(
"Failed to create asset stamp file $stamp_file_path. Please check that your web server has the proper access rights to do that."); "Failed to create asset stamp file $stamp_file_path. Please check that your web server has the proper access rights to do that.");
} }
/* } /* } else {
else {
@fclose($fp); @fclose($fp);
} }
*/ */
@@ -221,8 +233,8 @@ class AsseticAssetManager implements AssetManagerInterface
* @throws \InvalidArgumentException if a wrong filter is passed * @throws \InvalidArgumentException if a wrong filter is passed
* @return an array of filter names * @return an array of filter names
*/ */
protected function decodeAsseticFilters(FilterManager $filterManager, $filters) { protected function decodeAsseticFilters(FilterManager $filterManager, $filters)
{
if (!empty($filters)) { if (!empty($filters)) {
$filter_list = explode(',', $filters); $filter_list = explode(',', $filters);
@@ -261,8 +273,7 @@ class AsseticAssetManager implements AssetManagerInterface
break; break;
} }
} }
} } else {
else {
$filter_list = array(); $filter_list = array();
} }
@@ -272,73 +283,67 @@ class AsseticAssetManager implements AssetManagerInterface
/** /**
* Generates assets from $asset_path in $output_path, using $filters. * Generates assets from $asset_path in $output_path, using $filters.
* *
* @param $assetSource * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less)
* @param $assetDirectoryBase
* @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less)
* *
* @param string $webAssetsTemplate the full disk path to the base assets output directory in the web space * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space
* @param $webAssetsKey * @param string $output_url the URL to the base assets output directory in the web space
* @param string $outputUrl the URL to the base assets output directory in the web space
* *
* @param string $assetType the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension.
* @param array $filters a list of filters, as defined below (see switch($filter_name) ...) * @param array $filters a list of filters, as defined below (see switch($filter_name) ...)
* *
* @param boolean $debug true / false * @param boolean $debug true / false
* * @throws \InvalidArgumentException if an invalid filter name is found
* @return string The URL to the generated asset file. * @return string The URL to the generated asset file.
*/ */
public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug) public function processAsset($asset_path, $web_assets_directory_base, $output_url, $asset_type, $filters, $debug)
{ {
$assetName = basename($assetSource); $asset_name = basename($asset_path);
$inputDirectory = realpath(dirname($assetSource)); $input_directory = realpath(dirname($asset_path));
$assetFileDirectoryInAssetDirectory = trim(str_replace(array($assetDirectoryBase, $assetName), '', $assetSource), DS);
$am = new AssetManager(); $am = new AssetManager();
$fm = new FilterManager(); $fm = new FilterManager();
// Get the filter list // Get the filter list
$filterList = $this->decodeAsseticFilters($fm, $filters); $filter_list = $this->decodeAsseticFilters($fm, $filters);
// Factory setup // Factory setup
$factory = new AssetFactory($inputDirectory); $factory = new AssetFactory($input_directory);
$factory->setAssetManager($am); $factory->setAssetManager($am);
$factory->setFilterManager($fm); $factory->setFilterManager($fm);
$factory->setDefaultOutput('*' . (!empty($assetType) ? '.' : '') . $assetType); $factory->setDefaultOutput('*' . (!empty($asset_type) ? '.' : '') . $asset_type);
$factory->setDebug($debug); $factory->setDebug($debug);
$asset = $factory->createAsset($assetName, $filterList); $asset = $factory->createAsset($asset_name, $filter_list);
$outputDirectory = $this->getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey); $input_directory = realpath(dirname($asset_path));
$output_directory = $this->getDestinationDirectory($input_directory, $web_assets_directory_base);
// Get the URL part from the relative path // Get the URL part from the relative path
$outputRelativePath = $webAssetsTemplate . DS . $webAssetsKey; $output_relative_path = $this->getRelativeDirectoryPath($input_directory, $web_assets_directory_base);
$outputRelativeWebPath = rtrim(str_replace('\\', '/', $outputRelativePath), '/') . '/'; $output_relative_web_path = rtrim(str_replace('\\', '/', $output_relative_path), '/') . '/';
$assetTargetFilename = $asset->getTargetPath(); $asset_target_filename = $asset->getTargetPath();
/* // This is the final name of the generated asset
* This is the final name of the generated asset $asset_destination_path = $output_directory . DS . $asset_target_filename;
* We preserve file structure intending to keep - for example - relative css links working
*/
$assetDestinationPath = $outputDirectory . DS . $assetFileDirectoryInAssetDirectory . DS . $assetTargetFilename;
Tlog::getInstance()->addDebug("Asset destination full path: $assetDestinationPath"); Tlog::getInstance()->addDebug("Asset destination full path: $asset_destination_path");
// We generate an asset only if it does not exists, or if the asset processing is forced in development mode // We generate an asset only if it does not exists, or if the asset processing is forced in development mode
if (! file_exists($assetDestinationPath) || ($this->debugMode && ConfigQuery::read('process_assets', true)) ) { if (! file_exists($asset_destination_path) || ($this->debugMode && ConfigQuery::read('process_assets', true)) ) {
$writer = new AssetWriter($outputDirectory . DS . $assetFileDirectoryInAssetDirectory); $writer = new AssetWriter($output_directory);
Tlog::getInstance()->addDebug("Writing asset to $outputDirectory . DS . $assetFileDirectoryInAssetDirectory"); Tlog::getInstance()->addDebug("Writing asset to $output_directory");
$writer->writeAsset($asset); $writer->writeAsset($asset);
} }
return rtrim($outputUrl, '/') . '/' . trim($outputRelativeWebPath, '/') . '/' . trim($assetFileDirectoryInAssetDirectory, '/') . '/' . ltrim($assetTargetFilename, '/'); return rtrim($output_url, '/') . '/' . ltrim($output_relative_web_path, '/') . $asset_target_filename;
} }
} }

View File

@@ -277,7 +277,6 @@ abstract class BaseLoop
} }
} }
protected function searchArray(array $search, &$pagination = null) protected function searchArray(array $search, &$pagination = null)
{ {
if (false === $this->countable) { if (false === $this->countable) {

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AdminQuery; use Thelia\Model\AdminQuery;
use Thelia\Type;
/** /**
* *

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Template\Loop; namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;

View File

@@ -24,7 +24,6 @@
namespace Thelia\Core\Template\Loop; namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Util\PropelModelPager;
use Thelia\Condition\ConditionFactory; use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;

View File

@@ -158,6 +158,7 @@ class Currency extends BaseI18nLoop implements PropelSearchLoopInterface
} }
/* perform search */ /* perform search */
return $search; return $search;
} }

View File

@@ -36,9 +36,6 @@ use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\CustomerQuery; use Thelia\Model\CustomerQuery;
use Thelia\Type\TypeCollection; use Thelia\Type\TypeCollection;
use Thelia\Type; use Thelia\Type;
use Thelia\Model\OrderQuery;
use Thelia\Model\Map\OrderAddressTableMap;
use Thelia\Model\Map\OrderTableMap;
/** /**
* *
@@ -208,7 +205,6 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop
$search->orderByCreatedAt(Criteria::DESC); $search->orderByCreatedAt(Criteria::DESC);
break; break;
} }
} }

View File

@@ -126,7 +126,6 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface
if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0); if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0);
$orders = $this->getOrder(); $orders = $this->getOrder();
foreach ($orders as $order) { foreach ($orders as $order) {

View File

@@ -236,7 +236,6 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface
$search->filterById($exclude, Criteria::NOT_IN); $search->filterById($exclude, Criteria::NOT_IN);
// echo "sql=".$search->toString(); // echo "sql=".$search->toString();
return $search; return $search;
} }

View File

@@ -175,7 +175,6 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt
} }
return $search; return $search;
} }
public function parseResults(LoopResult $loopResult) public function parseResults(LoopResult $loopResult)
@@ -202,6 +201,7 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt
->set("STATUS", $order->getStatusId()) ->set("STATUS", $order->getStatusId())
->set("LANG", $order->getLangId()) ->set("LANG", $order->getLangId())
->set("POSTAGE", $order->getPostage()) ->set("POSTAGE", $order->getPostage())
->set("DISCOUNT", $order->getDiscount())
->set("TOTAL_TAX", $tax) ->set("TOTAL_TAX", $tax)
->set("TOTAL_AMOUNT", $amount - $tax) ->set("TOTAL_AMOUNT", $amount - $tax)
->set("TOTAL_TAXED_AMOUNT", $amount) ->set("TOTAL_TAXED_AMOUNT", $amount)

View File

@@ -0,0 +1,116 @@
<?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\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Model\OrderCouponQuery;
use Thelia\Model\OrderQuery;
use Thelia\Type;
/**
*
* OrderCoupon loop
*
*
* Class OrderCoupon
* @package Thelia\Core\Template\Loop
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class OrderCoupon extends BaseLoop implements PropelSearchLoopInterface
{
/**
* Define all args used in your loop
*
* @return ArgumentCollection
*/
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntTypeArgument('order', null, true)
);
}
public function buildModelCriteria()
{
$search = OrderCouponQuery::create();
$order = $this->getOrder();
$search->filterByOrderId($order, Criteria::EQUAL);
$search->orderById(Criteria::ASC);
return $search;
}
public function parseResults(LoopResult $loopResult)
{
$conditionFactory = $this->container->get('thelia.condition.factory');
/** @var OrderCoupon $orderCoupon */
foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
$loopResultRow = new LoopResultRow($orderCoupon);
$conditions = $conditionFactory->unserializeConditionCollection(
$orderCoupon->getSerializedConditions()
);
$now = time();
$datediff = $orderCoupon->getExpirationDate()->getTimestamp() - $now;
$daysLeftBeforeExpiration = floor($datediff/(60*60*24));
$cleanedConditions = array();
foreach ($conditions->getConditions() as $condition) {
$cleanedConditions[] = $condition->getToolTip();
}
$loopResultRow->set("ID", $orderCoupon->getId())
->set("CODE", $orderCoupon->getCode())
->set("TITLE", $orderCoupon->getTitle())
->set("SHORT_DESCRIPTION", $orderCoupon->getShortDescription())
->set("DESCRIPTION", $orderCoupon->getDescription())
->set("EXPIRATION_DATE", $orderCoupon->getExpirationDate( OrderQuery::create()->findPk($this->getOrder())->getLangId() ))
->set("USAGE_LEFT", $orderCoupon->getMaxUsage())
->set("IS_CUMULATIVE", $orderCoupon->getIsCumulative())
->set("IS_REMOVING_POSTAGE", $orderCoupon->getIsRemovingPostage())
->set("IS_AVAILABLE_ON_SPECIAL_OFFERS", $orderCoupon->getIsAvailableOnSpecialOffers())
->set("AMOUNT", $orderCoupon->getAmount())
->set("APPLICATION_CONDITIONS", $cleanedConditions)
->set("DAY_LEFT_BEFORE_EXPIRATION", $daysLeftBeforeExpiration)
;
$loopResult->addRow($loopResultRow);
}
return $loopResult;
}
}

View File

@@ -33,7 +33,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;
use Thelia\Type;
/** /**
* *

View File

@@ -23,19 +23,12 @@
namespace Thelia\Core\Template\Loop; namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Security\AccessManager;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Element\PropelSearchLoopInterface;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ModuleQuery;
use Thelia\Module\BaseModule;
use Thelia\Type; use Thelia\Type;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\Template\TemplateDefinition;
@@ -72,8 +65,14 @@ class Template extends BaseLoop implements ArraySearchLoopInterface
); );
} }
<<<<<<< HEAD
public function buildArray() { public function buildArray() {
$type = $this->getArg('template-type')->getValue(); $type = $this->getArg('template-type')->getValue();
=======
public function buildArray()
{
$type = $this->getArg(template_type);
>>>>>>> cleanmaster
if ($type == 'front-office') if ($type == 'front-office')
$templateType = TemplateDefinition::FRONT_OFFICE; $templateType = TemplateDefinition::FRONT_OFFICE;

View File

@@ -23,8 +23,11 @@
namespace Thelia\Core\Template\Smarty\Assets; namespace Thelia\Core\Template\Smarty\Assets;
<<<<<<< HEAD
use Thelia\Core\Template\Assets\AsseticHelper; use Thelia\Core\Template\Assets\AsseticHelper;
use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\Template\TemplateDefinition;
=======
>>>>>>> cleanmaster
use Thelia\Tools\URL; use Thelia\Tools\URL;
use Thelia\Core\Template\Assets\AssetManagerInterface; use Thelia\Core\Template\Assets\AssetManagerInterface;
@@ -56,6 +59,7 @@ class SmartyAssetsManager
public function prepareAssets($assets_directory, \Smarty_Internal_Template $template) public function prepareAssets($assets_directory, \Smarty_Internal_Template $template)
{ {
<<<<<<< HEAD
self::$assetsDirectory = $assets_directory; self::$assetsDirectory = $assets_directory;
$smartyParser = $template->smarty; $smartyParser = $template->smarty;
@@ -70,6 +74,9 @@ class SmartyAssetsManager
foreach($templateDirectories[$templateDefinition->getName()] as $key => $directory) { foreach($templateDirectories[$templateDefinition->getName()] as $key => $directory) {
$tpl_path = $directory . DS . self::$assetsDirectory; $tpl_path = $directory . DS . self::$assetsDirectory;
=======
$tpl_dir = dirname($template->source->filepath);
>>>>>>> cleanmaster
$asset_dir_absolute_path = realpath($tpl_path); $asset_dir_absolute_path = realpath($tpl_path);

View File

@@ -27,8 +27,6 @@ use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Tools\URL; use Thelia\Tools\URL;
use Thelia\Core\Security\SecurityContext; use Thelia\Core\Security\SecurityContext;
use Thelia\Model\Config;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateHelper;
/** /**
@@ -45,8 +43,8 @@ class AdminUtilities extends AbstractSmartyPlugin
$this->securityContext = $securityContext; $this->securityContext = $securityContext;
} }
protected function fetch_snippet($smarty, $templateName, $variablesArray) { protected function fetch_snippet($smarty, $templateName, $variablesArray)
{
$data = ''; $data = '';
$snippet_path = sprintf('%s/%s/%s.html', $snippet_path = sprintf('%s/%s/%s.html',
@@ -99,7 +97,6 @@ class AdminUtilities extends AbstractSmartyPlugin
$module === null ? array() : array($module), $module === null ? array() : array($module),
array($access)) array($access))
) { ) {
return $this->fetch_snippet($smarty, 'includes/admin-utilities-position-block', array( return $this->fetch_snippet($smarty, 'includes/admin-utilities-position-block', array(
'admin_utilities_go_up_url' => URL::getInstance()->absoluteUrl($path, array('mode' => 'up', $url_parameter => $id)), 'admin_utilities_go_up_url' => URL::getInstance()->absoluteUrl($path, array('mode' => 'up', $url_parameter => $id)),
'admin_utilities_in_place_edit_class' => $in_place_edit_class, 'admin_utilities_in_place_edit_class' => $in_place_edit_class,

View File

@@ -60,6 +60,7 @@ class Assets extends AbstractSmartyPlugin
$catchException = $this->getNormalizedParam($params, array('catchException')); $catchException = $this->getNormalizedParam($params, array('catchException'));
if ($catchException == "true") { if ($catchException == "true") {
$repeat = false; $repeat = false;
return null; return null;
} else { } else {
throw $e; throw $e;

View File

@@ -212,6 +212,8 @@ class DataAccessFunctions extends AbstractSmartyPlugin
switch ($attribute) { switch ($attribute) {
case 'postage': case 'postage':
return $order->getPostage(); return $order->getPostage();
case 'discount':
return $order->getDiscount();
case 'delivery_address': case 'delivery_address':
return $order->chosenDeliveryAddress; return $order->chosenDeliveryAddress;
case 'invoice_address': case 'invoice_address':

View File

@@ -28,7 +28,6 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\Smarty\an; use Thelia\Core\Template\Smarty\an;
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
/** /**
* Class Esi * Class Esi
* @package Thelia\Core\Template\Smarty\Plugins * @package Thelia\Core\Template\Smarty\Plugins

View File

@@ -14,9 +14,6 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\Exception\ResourceNotFoundException;
use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\ParserContext;
use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\Template\TemplateDefinition;
use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\TemplateHelper;
use Imagine\Exception\InvalidArgumentException;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
/** /**
@@ -35,12 +32,7 @@ class SmartyParser extends Smarty implements ParserInterface
protected $backOfficeTemplateDirectories = array(); protected $backOfficeTemplateDirectories = array();
protected $frontOfficeTemplateDirectories = array(); protected $frontOfficeTemplateDirectories = array();
protected $templateDirectories = array(); protected $template = "";
/**
* @var TemplateDefinition
*/
protected $templateDefinition = "";
protected $status = 200; protected $status = 200;
@@ -72,7 +64,6 @@ class SmartyParser extends Smarty implements ParserInterface
$this->setCompileDir($compile_dir); $this->setCompileDir($compile_dir);
$this->setCacheDir($cache_dir); $this->setCacheDir($cache_dir);
$this->debugging = $debug; $this->debugging = $debug;
// Prevent smarty ErrorException: Notice: Undefined index bla bla bla... // Prevent smarty ErrorException: Notice: Undefined index bla bla bla...
@@ -89,7 +80,6 @@ class SmartyParser extends Smarty implements ParserInterface
//$this->enableSecurity(); //$this->enableSecurity();
// The default HTTP status // The default HTTP status
$this->status = 200; $this->status = 200;
@@ -97,46 +87,6 @@ class SmartyParser extends Smarty implements ParserInterface
$this->registerFilter('variable', array(__CLASS__, "theliaEscape")); $this->registerFilter('variable', array(__CLASS__, "theliaEscape"));
} }
/**
* Add a template directory to the current template list
*
* @param unknown $templateType the template type (a TemplateDefinition type constant)
* @param string $templateName the template name
* @param string $templateDirectory path to the template dirtectory
* @param unknown $key ???
* @param string $unshift ??? Etienne ?
*/
public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false) {
if(true === $unshift && isset($this->templateDirectories[$templateType][$templateName])) {
$this->templateDirectories[$templateType][$templateName] = array_merge(
array(
$key => $templateDirectory,
),
$this->templateDirectories[$templateType][$templateName]
);
} else {
$this->templateDirectories[$templateType][$templateName][$key] = $templateDirectory;
}
}
/**
* Return the registeted template directories for a givent template type
*
* @param unknown $templateType
* @throws InvalidArgumentException
* @return multitype:
*/
public function getTemplateDirectories($templateType)
{
if (! isset($this->templateDirectories[$templateType])) {
throw new InvalidArgumentException("Failed to get template type %", $templateType);
}
return $this->templateDirectories[$templateType];
}
public function removeBlankLines($tpl_source, \Smarty_Internal_Template $template) public function removeBlankLines($tpl_source, \Smarty_Internal_Template $template)
{ {
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $tpl_source); return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $tpl_source);
@@ -151,46 +101,66 @@ class SmartyParser extends Smarty implements ParserInterface
} }
} }
public function addBackOfficeTemplateDirectory($templateName, $templateDirectory, $key)
{
$this->backOfficeTemplateDirectories[$templateName][$key] = $templateDirectory;
}
public function addFrontOfficeTemplateDirectory($templateName, $templateDirectory, $key)
{
$this->frontOfficeTemplateDirectories[$templateName][$key] = $templateDirectory;
}
/** /**
* @param TemplateDefinition $templateDefinition * @param TemplateDefinition $templateDefinition
*/ */
public function setTemplateDefinition(TemplateDefinition $templateDefinition) public function setTemplate(TemplateDefinition $templateDefinition)
{ {
$this->templateDefinition = $templateDefinition; $this->template = $templateDefinition->getPath();
/* init template directories */ /* init template directories */
$this->setTemplateDir(array()); $this->setTemplateDir(array());
/* add main template directory */
$this->addTemplateDir($templateDefinition->getAbsolutePath(), 0);
/* define config directory */ /* define config directory */
$configDirectory = THELIA_TEMPLATE_DIR . $this->getTemplate() . '/configs'; $configDirectory = $templateDefinition->getAbsoluteConfigPath();
$this->setConfigDir($configDirectory); $this->setConfigDir($configDirectory);
/* add modules template directories */ /* add modules template directories */
$this->addTemplateDirectory( switch ($templateDefinition->getType()) {
$templateDefinition->getType(), case TemplateDefinition::FRONT_OFFICE:
$templateDefinition->getName(),
THELIA_TEMPLATE_DIR . $this->getTemplate(),
'0',
true
);
/* do not pass array directly to addTemplateDir since we cant control on keys */ /* do not pass array directly to addTemplateDir since we cant control on keys */
if (isset($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()])) { if (isset($this->frontOfficeTemplateDirectories[$templateDefinition->getName()])) {
foreach($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) { foreach ($this->frontOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) {
$this->addTemplateDir($directory, $key); $this->addTemplateDir($directory, $key);
} }
} }
} break;
public function getTemplateDefinition() case TemplateDefinition::BACK_OFFICE:
{ /* do not pass array directly to addTemplateDir since we cant control on keys */
return $this->templateDefinition; if (isset($this->backOfficeTemplateDirectories[$templateDefinition->getName()])) {
foreach ($this->backOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) {
$this->addTemplateDir($directory, $key);
}
}
break;
case TemplateDefinition::PDF:
break;
default:
break;
}
} }
public function getTemplate() public function getTemplate()
{ {
return $this->templateDefinition->getPath(); return $this->template;
} }
/** /**
* Return a rendered template, either from file or ftom a string * Return a rendered template, either from file or ftom a string
* *

View File

@@ -35,13 +35,6 @@ class TemplateDefinition
const PDF_SUBDIR = 'pdf/'; const PDF_SUBDIR = 'pdf/';
const EMAIL_SUBDIR = 'email/'; const EMAIL_SUBDIR = 'email/';
protected static $standardTemplatesSubdirs = array(
self::FRONT_OFFICE => self::FRONT_OFFICE_SUBDIR,
self::BACK_OFFICE => self::BACK_OFFICE_SUBDIR,
self::PDF => self::PDF_SUBDIR,
self::EMAIL => self::EMAIL_SUBDIR,
);
/** /**
* @var the template directory name (e.g. 'default') * @var the template directory name (e.g. 'default')
*/ */
@@ -57,7 +50,6 @@ class TemplateDefinition
*/ */
protected $type; protected $type;
public function __construct($name, $type) public function __construct($name, $type)
{ {
$this->name = $name; $this->name = $name;
@@ -90,14 +82,17 @@ class TemplateDefinition
public function setName($name) public function setName($name)
{ {
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
public function getI18nPath() { public function getI18nPath()
{
return $this->getPath() . DS . 'I18n'; return $this->getPath() . DS . 'I18n';
} }
public function getAbsoluteI18nPath() { public function getAbsoluteI18nPath()
{
return THELIA_TEMPLATE_DIR . $this->getI18nPath(); return THELIA_TEMPLATE_DIR . $this->getI18nPath();
} }
@@ -106,7 +101,8 @@ class TemplateDefinition
return $this->path; return $this->path;
} }
public function getAbsolutePath() { public function getAbsolutePath()
{
return THELIA_TEMPLATE_DIR . $this->getPath(); return THELIA_TEMPLATE_DIR . $this->getPath();
} }
@@ -115,13 +111,15 @@ class TemplateDefinition
return $this->getPath() . DS . 'configs'; return $this->getPath() . DS . 'configs';
} }
public function getAbsoluteConfigPath() { public function getAbsoluteConfigPath()
{
return THELIA_TEMPLATE_DIR . $this->getConfigPath(); return THELIA_TEMPLATE_DIR . $this->getConfigPath();
} }
public function setPath($path) public function setPath($path)
{ {
$this->path = $path; $this->path = $path;
return $this; return $this;
} }
@@ -133,13 +131,7 @@ class TemplateDefinition
public function setType($type) public function setType($type)
{ {
$this->type = $type; $this->type = $type;
return $this; return $this;
} }
/**
* Returns an iterator on the standard templates subdir names
*/
public static function getStandardTemplatesSubdirsIterator() {
return new \ArrayIterator(self::$standardTemplatesSubdirs);
}
} }

View File

@@ -40,16 +40,17 @@ class TemplateHelper
private function __construct() {} private function __construct() {}
public static function getInstance() { public static function getInstance()
{
if (self::$instance == null) self::$instance = new TemplateHelper(); if (self::$instance == null) self::$instance = new TemplateHelper();
return self::$instance; return self::$instance;
} }
/** /**
* @return TemplateDefinition * @return TemplateDefinition
*/ */
public function getActiveMailTemplate() { public function getActiveMailTemplate()
{
return new TemplateDefinition( return new TemplateDefinition(
ConfigQuery::read('active-mail-template', 'default'), ConfigQuery::read('active-mail-template', 'default'),
TemplateDefinition::EMAIL TemplateDefinition::EMAIL
@@ -59,7 +60,8 @@ class TemplateHelper
/** /**
* @return TemplateDefinition * @return TemplateDefinition
*/ */
public function getActivePdfTemplate() { public function getActivePdfTemplate()
{
return new TemplateDefinition( return new TemplateDefinition(
ConfigQuery::read('active-pdf-template', 'default'), ConfigQuery::read('active-pdf-template', 'default'),
TemplateDefinition::PDF TemplateDefinition::PDF
@@ -69,7 +71,8 @@ class TemplateHelper
/** /**
* @return TemplateDefinition * @return TemplateDefinition
*/ */
public function getActiveAdminTemplate() { public function getActiveAdminTemplate()
{
return new TemplateDefinition( return new TemplateDefinition(
ConfigQuery::read('active-admin-template', 'default'), ConfigQuery::read('active-admin-template', 'default'),
TemplateDefinition::BACK_OFFICE TemplateDefinition::BACK_OFFICE
@@ -79,13 +82,15 @@ class TemplateHelper
/** /**
* @return TemplateDefinition * @return TemplateDefinition
*/ */
public function getActiveFrontTemplate() { public function getActiveFrontTemplate()
{
return new TemplateDefinition( return new TemplateDefinition(
ConfigQuery::read('active-front-template', 'default'), ConfigQuery::read('active-front-template', 'default'),
TemplateDefinition::FRONT_OFFICE TemplateDefinition::FRONT_OFFICE
); );
} }
<<<<<<< HEAD
/** /**
* Returns an array which contains all standard template definitions * Returns an array which contains all standard template definitions
*/ */
@@ -109,6 +114,18 @@ class TemplateHelper
$list = $exclude = array(); $list = $exclude = array();
$tplIterator = TemplateDefinition::getStandardTemplatesSubdirsIterator(); $tplIterator = TemplateDefinition::getStandardTemplatesSubdirsIterator();
=======
public function getList($templateType)
{
$list = $exclude = array();
if ($templateType == TemplateDefinition::BACK_OFFICE) {
$baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::BACK_OFFICE_SUBDIR;
} elseif ($templateType == TemplateDefinition::PDF) {
$baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::PDF_SUBDIR;
} else {
$baseDir = THELIA_TEMPLATE_DIR.TemplateDefinition::FRONT_OFFICE_SUBDIR;
>>>>>>> cleanmaster
foreach($tplIterator as $type => $subdir) { foreach($tplIterator as $type => $subdir) {
@@ -134,7 +151,6 @@ class TemplateHelper
} }
} }
protected function normalize_path($path) protected function normalize_path($path)
{ {
$path = str_replace( $path = str_replace(
@@ -163,8 +179,8 @@ class TemplateHelper
* @throws \InvalidArgumentException if $walkMode contains an invalid value * @throws \InvalidArgumentException if $walkMode contains an invalid value
* @return number the total number of translatable texts * @return number the total number of translatable texts
*/ */
public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings) { public function walkDir($directory, $walkMode, Translator $translator, $currentLocale, &$strings)
{
$num_texts = 0; $num_texts = 0;
if ($walkMode == self::WALK_MODE_PHP) { if ($walkMode == self::WALK_MODE_PHP) {
@@ -175,8 +191,7 @@ class TemplateHelper
$prefix = '\{intl[\s]l='; $prefix = '\{intl[\s]l=';
$allowed_exts = array('html', 'tpl', 'xml'); $allowed_exts = array('html', 'tpl', 'xml');
} } else {
else {
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
Translator::getInstance()->trans('Invalid value for walkMode parameter: %value', array('%value' => $walkMode)) Translator::getInstance()->trans('Invalid value for walkMode parameter: %value', array('%value' => $walkMode))
); );
@@ -214,14 +229,11 @@ class TemplateHelper
$hash = md5($match); $hash = md5($match);
if (isset($strings[$hash])) if (isset($strings[$hash])) {
{ if (! in_array($short_path, $strings[$hash]['files'])) {
if (! in_array($short_path, $strings[$hash]['files']))
{
$strings[$hash]['files'][] = $short_path; $strings[$hash]['files'][] = $short_path;
} }
} } else {
else {
$num_texts++; $num_texts++;
// remove \' // remove \'
@@ -273,9 +285,7 @@ class TemplateHelper
fwrite($fp, ");\n"); fwrite($fp, ");\n");
@fclose($fp); @fclose($fp);
} } else {
else
{
throw new \RuntimeException( throw new \RuntimeException(
Translator::getInstance()->trans( Translator::getInstance()->trans(
'Failed to open translation file %file. Please be sure that this file is writable by your Web server', 'Failed to open translation file %file. Please be sure that this file is writable by your Web server',

View File

@@ -49,7 +49,6 @@ use Thelia\Config\DefinePropel;
use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\Template\TemplateDefinition;
use Thelia\Core\TheliaContainerBuilder; use Thelia\Core\TheliaContainerBuilder;
use Thelia\Core\DependencyInjection\Loader\XmlFileLoader; use Thelia\Core\DependencyInjection\Loader\XmlFileLoader;
use Thelia\Model\ConfigQuery;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use Propel\Runtime\Propel; use Propel\Runtime\Propel;
@@ -198,6 +197,11 @@ class Thelia extends Kernel
$definition $definition
); );
<<<<<<< HEAD
=======
$code = ucfirst($module->getCode());
>>>>>>> cleanmaster
$loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath())); $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath()));
$loader->load("config.xml"); $loader->load("config.xml");

View File

@@ -78,15 +78,8 @@ class CouponManager
if (count($this->coupons) > 0) { if (count($this->coupons) > 0) {
$couponsKept = $this->sortCoupons($this->coupons); $couponsKept = $this->sortCoupons($this->coupons);
$isRemovingPostage = $this->isCouponRemovingPostage($couponsKept);
$discount = $this->getEffect($couponsKept); $discount = $this->getEffect($couponsKept);
if ($isRemovingPostage) {
$postage = $this->facade->getCheckoutPostagePrice();
$discount += $postage;
}
// Just In Case test // Just In Case test
$checkoutTotalPrice = $this->facade->getCartTotalPrice(); $checkoutTotalPrice = $this->facade->getCartTotalPrice();
if ($discount >= $checkoutTotalPrice) { if ($discount >= $checkoutTotalPrice) {
@@ -99,23 +92,24 @@ class CouponManager
/** /**
* Check if there is a Coupon removing Postage * Check if there is a Coupon removing Postage
*
* @param array $couponsKept Array of CouponInterface sorted
*
* @return bool * @return bool
*/ */
protected function isCouponRemovingPostage(array $couponsKept) public function isCouponRemovingPostage()
{ {
$isRemovingPostage = false; if (count($this->coupons) == 0) {
return false;
}
$couponsKept = $this->sortCoupons($this->coupons);
/** @var CouponInterface $coupon */ /** @var CouponInterface $coupon */
foreach ($couponsKept as $coupon) { foreach ($couponsKept as $coupon) {
if ($coupon->isRemovingPostage()) { if ($coupon->isRemovingPostage()) {
$isRemovingPostage = true; return true;
} }
} }
return $isRemovingPostage; return false;
} }
/** /**

View File

@@ -23,7 +23,6 @@
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Model\CustomerQuery; use Thelia\Model\CustomerQuery;
/** /**

View File

@@ -23,7 +23,6 @@
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Model\ProfileQuery; use Thelia\Model\ProfileQuery;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan; use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Model\Currency; use Thelia\Model\Currency;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;

View File

@@ -25,7 +25,6 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan; use Symfony\Component\Validator\Constraints\GreaterThan;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
class ProductModificationForm extends ProductCreationForm class ProductModificationForm extends ProductCreationForm
{ {
use StandardDescriptionFieldsTrait; use StandardDescriptionFieldsTrait;

View File

@@ -23,8 +23,6 @@
namespace Thelia\Form; namespace Thelia\Form;
use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints;
use Thelia\Model\ConfigQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Log\Tlog; use Thelia\Log\Tlog;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;

View File

@@ -58,7 +58,7 @@ class CheckPermission extends BaseInstall
/** @var array Minimum server configuration necessary */ /** @var array Minimum server configuration necessary */
protected $minServerConfigurationNecessary = array( protected $minServerConfigurationNecessary = array(
'memory_limit' => 157286400, 'memory_limit' => 134217728,
'post_max_size' => 20971520, 'post_max_size' => 20971520,
'upload_max_filesize' => 2097152 'upload_max_filesize' => 2097152
); );

View File

@@ -25,18 +25,20 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination; use Thelia\Log\AbstractTlogDestination;
class TlogDestinationJavascriptConsole extends AbstractTlogDestination { class TlogDestinationJavascriptConsole extends AbstractTlogDestination
{
public function getTitle() { public function getTitle()
{
return "Browser's Javascript console"; return "Browser's Javascript console";
} }
public function getDescription() { public function getDescription()
{
return "The Thelia logs are displayed in your browser's Javascript console."; return "The Thelia logs are displayed in your browser's Javascript console.";
} }
public function write(&$res) { public function write(&$res)
{
$content = '<script>try {'."\n"; $content = '<script>try {'."\n";
foreach ($this->_logs as $line) { foreach ($this->_logs as $line) {

View File

@@ -26,8 +26,8 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination; use Thelia\Log\AbstractTlogDestination;
use Thelia\Log\TlogDestinationConfig; use Thelia\Log\TlogDestinationConfig;
class TlogDestinationPopup extends AbstractTlogDestination { class TlogDestinationPopup extends AbstractTlogDestination
{
// Nom des variables de configuration // Nom des variables de configuration
// ---------------------------------- // ----------------------------------
const VAR_POPUP_WIDTH = "tlog_destinationpopup_width"; const VAR_POPUP_WIDTH = "tlog_destinationpopup_width";
@@ -40,15 +40,18 @@ class TlogDestinationPopup extends AbstractTlogDestination {
// Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php // Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php
const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl"; const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl";
public function getTitle() { public function getTitle()
{
return "Javascript popup window"; return "Javascript popup window";
} }
public function getDescription() { public function getDescription()
{
return "Display logs in a popup window, separate from the main window ."; return "Display logs in a popup window, separate from the main window .";
} }
public function getConfigs() { public function getConfigs()
{
return array( return array(
new TlogDestinationConfig( new TlogDestinationConfig(
self::VAR_POPUP_TPL, self::VAR_POPUP_TPL,
@@ -74,8 +77,8 @@ class TlogDestinationPopup extends AbstractTlogDestination {
); );
} }
public function write(&$res) { public function write(&$res)
{
$content = ""; $count = 1; $content = ""; $count = 1;
foreach ($this->_logs as $line) { foreach ($this->_logs as $line) {
@@ -92,8 +95,7 @@ class TlogDestinationPopup extends AbstractTlogDestination {
_thelia_console = window.open("","thelia_console","width=%s,height=%s,resizable,scrollbars=yes"); _thelia_console = window.open("","thelia_console","width=%s,height=%s,resizable,scrollbars=yes");
if (_thelia_console == null) { if (_thelia_console == null) {
alert("The log popup window could not be opened. Please disable your popup blocker for this site."); alert("The log popup window could not be opened. Please disable your popup blocker for this site.");
} } else {
else {
_thelia_console.document.write("%s"); _thelia_console.document.write("%s");
_thelia_console.document.close(); _thelia_console.document.close();
} }

View File

@@ -171,7 +171,8 @@ class Tlog Implements LoggerInterface
* *
* @return array of directories * @return array of directories
*/ */
public function getDestinationsDirectories() { public function getDestinationsDirectories()
{
return $this->dir_destinations; return $this->dir_destinations;
} }

View File

@@ -22,7 +22,6 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Log; namespace Thelia\Log;
use Thelia\Model\Config;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
class TlogDestinationConfig class TlogDestinationConfig

View File

@@ -902,26 +902,26 @@ abstract class Accessory implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AccessoryTableMap::ID)) { if ($this->isColumnModified(AccessoryTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AccessoryTableMap::PRODUCT_ID)) { if ($this->isColumnModified(AccessoryTableMap::PRODUCT_ID)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`';
} }
if ($this->isColumnModified(AccessoryTableMap::ACCESSORY)) { if ($this->isColumnModified(AccessoryTableMap::ACCESSORY)) {
$modifiedColumns[':p' . $index++] = 'ACCESSORY'; $modifiedColumns[':p' . $index++] = '`ACCESSORY`';
} }
if ($this->isColumnModified(AccessoryTableMap::POSITION)) { if ($this->isColumnModified(AccessoryTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION'; $modifiedColumns[':p' . $index++] = '`POSITION`';
} }
if ($this->isColumnModified(AccessoryTableMap::CREATED_AT)) { if ($this->isColumnModified(AccessoryTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AccessoryTableMap::UPDATED_AT)) { if ($this->isColumnModified(AccessoryTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO accessory (%s) VALUES (%s)', 'INSERT INTO `accessory` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -930,22 +930,22 @@ abstract class Accessory implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'PRODUCT_ID': case '`PRODUCT_ID`':
$stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
break; break;
case 'ACCESSORY': case '`ACCESSORY`':
$stmt->bindValue($identifier, $this->accessory, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->accessory, PDO::PARAM_INT);
break; break;
case 'POSITION': case '`POSITION`':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -151,7 +151,7 @@ abstract class AccessoryQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, PRODUCT_ID, ACCESSORY, POSITION, CREATED_AT, UPDATED_AT FROM accessory WHERE ID = :p0'; $sql = 'SELECT `ID`, `PRODUCT_ID`, `ACCESSORY`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `accessory` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -1503,62 +1503,62 @@ abstract class Address implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AddressTableMap::ID)) { if ($this->isColumnModified(AddressTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AddressTableMap::LABEL)) { if ($this->isColumnModified(AddressTableMap::LABEL)) {
$modifiedColumns[':p' . $index++] = 'LABEL'; $modifiedColumns[':p' . $index++] = '`LABEL`';
} }
if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) { if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) {
$modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; $modifiedColumns[':p' . $index++] = '`CUSTOMER_ID`';
} }
if ($this->isColumnModified(AddressTableMap::TITLE_ID)) { if ($this->isColumnModified(AddressTableMap::TITLE_ID)) {
$modifiedColumns[':p' . $index++] = 'TITLE_ID'; $modifiedColumns[':p' . $index++] = '`TITLE_ID`';
} }
if ($this->isColumnModified(AddressTableMap::COMPANY)) { if ($this->isColumnModified(AddressTableMap::COMPANY)) {
$modifiedColumns[':p' . $index++] = 'COMPANY'; $modifiedColumns[':p' . $index++] = '`COMPANY`';
} }
if ($this->isColumnModified(AddressTableMap::FIRSTNAME)) { if ($this->isColumnModified(AddressTableMap::FIRSTNAME)) {
$modifiedColumns[':p' . $index++] = 'FIRSTNAME'; $modifiedColumns[':p' . $index++] = '`FIRSTNAME`';
} }
if ($this->isColumnModified(AddressTableMap::LASTNAME)) { if ($this->isColumnModified(AddressTableMap::LASTNAME)) {
$modifiedColumns[':p' . $index++] = 'LASTNAME'; $modifiedColumns[':p' . $index++] = '`LASTNAME`';
} }
if ($this->isColumnModified(AddressTableMap::ADDRESS1)) { if ($this->isColumnModified(AddressTableMap::ADDRESS1)) {
$modifiedColumns[':p' . $index++] = 'ADDRESS1'; $modifiedColumns[':p' . $index++] = '`ADDRESS1`';
} }
if ($this->isColumnModified(AddressTableMap::ADDRESS2)) { if ($this->isColumnModified(AddressTableMap::ADDRESS2)) {
$modifiedColumns[':p' . $index++] = 'ADDRESS2'; $modifiedColumns[':p' . $index++] = '`ADDRESS2`';
} }
if ($this->isColumnModified(AddressTableMap::ADDRESS3)) { if ($this->isColumnModified(AddressTableMap::ADDRESS3)) {
$modifiedColumns[':p' . $index++] = 'ADDRESS3'; $modifiedColumns[':p' . $index++] = '`ADDRESS3`';
} }
if ($this->isColumnModified(AddressTableMap::ZIPCODE)) { if ($this->isColumnModified(AddressTableMap::ZIPCODE)) {
$modifiedColumns[':p' . $index++] = 'ZIPCODE'; $modifiedColumns[':p' . $index++] = '`ZIPCODE`';
} }
if ($this->isColumnModified(AddressTableMap::CITY)) { if ($this->isColumnModified(AddressTableMap::CITY)) {
$modifiedColumns[':p' . $index++] = 'CITY'; $modifiedColumns[':p' . $index++] = '`CITY`';
} }
if ($this->isColumnModified(AddressTableMap::COUNTRY_ID)) { if ($this->isColumnModified(AddressTableMap::COUNTRY_ID)) {
$modifiedColumns[':p' . $index++] = 'COUNTRY_ID'; $modifiedColumns[':p' . $index++] = '`COUNTRY_ID`';
} }
if ($this->isColumnModified(AddressTableMap::PHONE)) { if ($this->isColumnModified(AddressTableMap::PHONE)) {
$modifiedColumns[':p' . $index++] = 'PHONE'; $modifiedColumns[':p' . $index++] = '`PHONE`';
} }
if ($this->isColumnModified(AddressTableMap::CELLPHONE)) { if ($this->isColumnModified(AddressTableMap::CELLPHONE)) {
$modifiedColumns[':p' . $index++] = 'CELLPHONE'; $modifiedColumns[':p' . $index++] = '`CELLPHONE`';
} }
if ($this->isColumnModified(AddressTableMap::IS_DEFAULT)) { if ($this->isColumnModified(AddressTableMap::IS_DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'IS_DEFAULT'; $modifiedColumns[':p' . $index++] = '`IS_DEFAULT`';
} }
if ($this->isColumnModified(AddressTableMap::CREATED_AT)) { if ($this->isColumnModified(AddressTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AddressTableMap::UPDATED_AT)) { if ($this->isColumnModified(AddressTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO address (%s) VALUES (%s)', 'INSERT INTO `address` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1567,58 +1567,58 @@ abstract class Address implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'LABEL': case '`LABEL`':
$stmt->bindValue($identifier, $this->label, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->label, PDO::PARAM_STR);
break; break;
case 'CUSTOMER_ID': case '`CUSTOMER_ID`':
$stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
break; break;
case 'TITLE_ID': case '`TITLE_ID`':
$stmt->bindValue($identifier, $this->title_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->title_id, PDO::PARAM_INT);
break; break;
case 'COMPANY': case '`COMPANY`':
$stmt->bindValue($identifier, $this->company, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->company, PDO::PARAM_STR);
break; break;
case 'FIRSTNAME': case '`FIRSTNAME`':
$stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR);
break; break;
case 'LASTNAME': case '`LASTNAME`':
$stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR);
break; break;
case 'ADDRESS1': case '`ADDRESS1`':
$stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR);
break; break;
case 'ADDRESS2': case '`ADDRESS2`':
$stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR);
break; break;
case 'ADDRESS3': case '`ADDRESS3`':
$stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR);
break; break;
case 'ZIPCODE': case '`ZIPCODE`':
$stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR);
break; break;
case 'CITY': case '`CITY`':
$stmt->bindValue($identifier, $this->city, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->city, PDO::PARAM_STR);
break; break;
case 'COUNTRY_ID': case '`COUNTRY_ID`':
$stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT);
break; break;
case 'PHONE': case '`PHONE`':
$stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR);
break; break;
case 'CELLPHONE': case '`CELLPHONE`':
$stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR);
break; break;
case 'IS_DEFAULT': case '`IS_DEFAULT`':
$stmt->bindValue($identifier, $this->is_default, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->is_default, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -211,7 +211,7 @@ abstract class AddressQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, LABEL, CUSTOMER_ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0'; $sql = 'SELECT `ID`, `LABEL`, `CUSTOMER_ID`, `TITLE_ID`, `COMPANY`, `FIRSTNAME`, `LASTNAME`, `ADDRESS1`, `ADDRESS2`, `ADDRESS3`, `ZIPCODE`, `CITY`, `COUNTRY_ID`, `PHONE`, `CELLPHONE`, `IS_DEFAULT`, `CREATED_AT`, `UPDATED_AT` FROM `address` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -1128,44 +1128,44 @@ abstract class Admin implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AdminTableMap::ID)) { if ($this->isColumnModified(AdminTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AdminTableMap::PROFILE_ID)) { if ($this->isColumnModified(AdminTableMap::PROFILE_ID)) {
$modifiedColumns[':p' . $index++] = 'PROFILE_ID'; $modifiedColumns[':p' . $index++] = '`PROFILE_ID`';
} }
if ($this->isColumnModified(AdminTableMap::FIRSTNAME)) { if ($this->isColumnModified(AdminTableMap::FIRSTNAME)) {
$modifiedColumns[':p' . $index++] = 'FIRSTNAME'; $modifiedColumns[':p' . $index++] = '`FIRSTNAME`';
} }
if ($this->isColumnModified(AdminTableMap::LASTNAME)) { if ($this->isColumnModified(AdminTableMap::LASTNAME)) {
$modifiedColumns[':p' . $index++] = 'LASTNAME'; $modifiedColumns[':p' . $index++] = '`LASTNAME`';
} }
if ($this->isColumnModified(AdminTableMap::LOGIN)) { if ($this->isColumnModified(AdminTableMap::LOGIN)) {
$modifiedColumns[':p' . $index++] = 'LOGIN'; $modifiedColumns[':p' . $index++] = '`LOGIN`';
} }
if ($this->isColumnModified(AdminTableMap::PASSWORD)) { if ($this->isColumnModified(AdminTableMap::PASSWORD)) {
$modifiedColumns[':p' . $index++] = 'PASSWORD'; $modifiedColumns[':p' . $index++] = '`PASSWORD`';
} }
if ($this->isColumnModified(AdminTableMap::ALGO)) { if ($this->isColumnModified(AdminTableMap::ALGO)) {
$modifiedColumns[':p' . $index++] = 'ALGO'; $modifiedColumns[':p' . $index++] = '`ALGO`';
} }
if ($this->isColumnModified(AdminTableMap::SALT)) { if ($this->isColumnModified(AdminTableMap::SALT)) {
$modifiedColumns[':p' . $index++] = 'SALT'; $modifiedColumns[':p' . $index++] = '`SALT`';
} }
if ($this->isColumnModified(AdminTableMap::REMEMBER_ME_TOKEN)) { if ($this->isColumnModified(AdminTableMap::REMEMBER_ME_TOKEN)) {
$modifiedColumns[':p' . $index++] = 'REMEMBER_ME_TOKEN'; $modifiedColumns[':p' . $index++] = '`REMEMBER_ME_TOKEN`';
} }
if ($this->isColumnModified(AdminTableMap::REMEMBER_ME_SERIAL)) { if ($this->isColumnModified(AdminTableMap::REMEMBER_ME_SERIAL)) {
$modifiedColumns[':p' . $index++] = 'REMEMBER_ME_SERIAL'; $modifiedColumns[':p' . $index++] = '`REMEMBER_ME_SERIAL`';
} }
if ($this->isColumnModified(AdminTableMap::CREATED_AT)) { if ($this->isColumnModified(AdminTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AdminTableMap::UPDATED_AT)) { if ($this->isColumnModified(AdminTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO admin (%s) VALUES (%s)', 'INSERT INTO `admin` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1174,40 +1174,40 @@ abstract class Admin implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'PROFILE_ID': case '`PROFILE_ID`':
$stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT);
break; break;
case 'FIRSTNAME': case '`FIRSTNAME`':
$stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR);
break; break;
case 'LASTNAME': case '`LASTNAME`':
$stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR);
break; break;
case 'LOGIN': case '`LOGIN`':
$stmt->bindValue($identifier, $this->login, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->login, PDO::PARAM_STR);
break; break;
case 'PASSWORD': case '`PASSWORD`':
$stmt->bindValue($identifier, $this->password, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->password, PDO::PARAM_STR);
break; break;
case 'ALGO': case '`ALGO`':
$stmt->bindValue($identifier, $this->algo, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->algo, PDO::PARAM_STR);
break; break;
case 'SALT': case '`SALT`':
$stmt->bindValue($identifier, $this->salt, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->salt, PDO::PARAM_STR);
break; break;
case 'REMEMBER_ME_TOKEN': case '`REMEMBER_ME_TOKEN`':
$stmt->bindValue($identifier, $this->remember_me_token, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->remember_me_token, PDO::PARAM_STR);
break; break;
case 'REMEMBER_ME_SERIAL': case '`REMEMBER_ME_SERIAL`':
$stmt->bindValue($identifier, $this->remember_me_serial, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->remember_me_serial, PDO::PARAM_STR);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -1019,38 +1019,38 @@ abstract class AdminLog implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AdminLogTableMap::ID)) { if ($this->isColumnModified(AdminLogTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AdminLogTableMap::ADMIN_LOGIN)) { if ($this->isColumnModified(AdminLogTableMap::ADMIN_LOGIN)) {
$modifiedColumns[':p' . $index++] = 'ADMIN_LOGIN'; $modifiedColumns[':p' . $index++] = '`ADMIN_LOGIN`';
} }
if ($this->isColumnModified(AdminLogTableMap::ADMIN_FIRSTNAME)) { if ($this->isColumnModified(AdminLogTableMap::ADMIN_FIRSTNAME)) {
$modifiedColumns[':p' . $index++] = 'ADMIN_FIRSTNAME'; $modifiedColumns[':p' . $index++] = '`ADMIN_FIRSTNAME`';
} }
if ($this->isColumnModified(AdminLogTableMap::ADMIN_LASTNAME)) { if ($this->isColumnModified(AdminLogTableMap::ADMIN_LASTNAME)) {
$modifiedColumns[':p' . $index++] = 'ADMIN_LASTNAME'; $modifiedColumns[':p' . $index++] = '`ADMIN_LASTNAME`';
} }
if ($this->isColumnModified(AdminLogTableMap::RESOURCE)) { if ($this->isColumnModified(AdminLogTableMap::RESOURCE)) {
$modifiedColumns[':p' . $index++] = 'RESOURCE'; $modifiedColumns[':p' . $index++] = '`RESOURCE`';
} }
if ($this->isColumnModified(AdminLogTableMap::ACTION)) { if ($this->isColumnModified(AdminLogTableMap::ACTION)) {
$modifiedColumns[':p' . $index++] = 'ACTION'; $modifiedColumns[':p' . $index++] = '`ACTION`';
} }
if ($this->isColumnModified(AdminLogTableMap::MESSAGE)) { if ($this->isColumnModified(AdminLogTableMap::MESSAGE)) {
$modifiedColumns[':p' . $index++] = 'MESSAGE'; $modifiedColumns[':p' . $index++] = '`MESSAGE`';
} }
if ($this->isColumnModified(AdminLogTableMap::REQUEST)) { if ($this->isColumnModified(AdminLogTableMap::REQUEST)) {
$modifiedColumns[':p' . $index++] = 'REQUEST'; $modifiedColumns[':p' . $index++] = '`REQUEST`';
} }
if ($this->isColumnModified(AdminLogTableMap::CREATED_AT)) { if ($this->isColumnModified(AdminLogTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AdminLogTableMap::UPDATED_AT)) { if ($this->isColumnModified(AdminLogTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO admin_log (%s) VALUES (%s)', 'INSERT INTO `admin_log` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1059,34 +1059,34 @@ abstract class AdminLog implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'ADMIN_LOGIN': case '`ADMIN_LOGIN`':
$stmt->bindValue($identifier, $this->admin_login, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->admin_login, PDO::PARAM_STR);
break; break;
case 'ADMIN_FIRSTNAME': case '`ADMIN_FIRSTNAME`':
$stmt->bindValue($identifier, $this->admin_firstname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->admin_firstname, PDO::PARAM_STR);
break; break;
case 'ADMIN_LASTNAME': case '`ADMIN_LASTNAME`':
$stmt->bindValue($identifier, $this->admin_lastname, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->admin_lastname, PDO::PARAM_STR);
break; break;
case 'RESOURCE': case '`RESOURCE`':
$stmt->bindValue($identifier, $this->resource, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->resource, PDO::PARAM_STR);
break; break;
case 'ACTION': case '`ACTION`':
$stmt->bindValue($identifier, $this->action, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->action, PDO::PARAM_STR);
break; break;
case 'MESSAGE': case '`MESSAGE`':
$stmt->bindValue($identifier, $this->message, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->message, PDO::PARAM_STR);
break; break;
case 'REQUEST': case '`REQUEST`':
$stmt->bindValue($identifier, $this->request, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->request, PDO::PARAM_STR);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -156,7 +156,7 @@ abstract class AdminLogQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, ADMIN_LOGIN, ADMIN_FIRSTNAME, ADMIN_LASTNAME, RESOURCE, ACTION, MESSAGE, REQUEST, CREATED_AT, UPDATED_AT FROM admin_log WHERE ID = :p0'; $sql = 'SELECT `ID`, `ADMIN_LOGIN`, `ADMIN_FIRSTNAME`, `ADMIN_LASTNAME`, `RESOURCE`, `ACTION`, `MESSAGE`, `REQUEST`, `CREATED_AT`, `UPDATED_AT` FROM `admin_log` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -171,7 +171,7 @@ abstract class AdminQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, PROFILE_ID, FIRSTNAME, LASTNAME, LOGIN, PASSWORD, ALGO, SALT, REMEMBER_ME_TOKEN, REMEMBER_ME_SERIAL, CREATED_AT, UPDATED_AT FROM admin WHERE ID = :p0'; $sql = 'SELECT `ID`, `PROFILE_ID`, `FIRSTNAME`, `LASTNAME`, `LOGIN`, `PASSWORD`, `ALGO`, `SALT`, `REMEMBER_ME_TOKEN`, `REMEMBER_ME_SERIAL`, `CREATED_AT`, `UPDATED_AT` FROM `admin` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -882,23 +882,23 @@ abstract class Area implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AreaTableMap::ID)) { if ($this->isColumnModified(AreaTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AreaTableMap::NAME)) { if ($this->isColumnModified(AreaTableMap::NAME)) {
$modifiedColumns[':p' . $index++] = 'NAME'; $modifiedColumns[':p' . $index++] = '`NAME`';
} }
if ($this->isColumnModified(AreaTableMap::POSTAGE)) { if ($this->isColumnModified(AreaTableMap::POSTAGE)) {
$modifiedColumns[':p' . $index++] = 'POSTAGE'; $modifiedColumns[':p' . $index++] = '`POSTAGE`';
} }
if ($this->isColumnModified(AreaTableMap::CREATED_AT)) { if ($this->isColumnModified(AreaTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AreaTableMap::UPDATED_AT)) { if ($this->isColumnModified(AreaTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO area (%s) VALUES (%s)', 'INSERT INTO `area` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -907,19 +907,19 @@ abstract class Area implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'NAME': case '`NAME`':
$stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
break; break;
case 'POSTAGE': case '`POSTAGE`':
$stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -863,23 +863,23 @@ abstract class AreaDeliveryModule implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AreaDeliveryModuleTableMap::ID)) { if ($this->isColumnModified(AreaDeliveryModuleTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AreaDeliveryModuleTableMap::AREA_ID)) { if ($this->isColumnModified(AreaDeliveryModuleTableMap::AREA_ID)) {
$modifiedColumns[':p' . $index++] = 'AREA_ID'; $modifiedColumns[':p' . $index++] = '`AREA_ID`';
} }
if ($this->isColumnModified(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID)) { if ($this->isColumnModified(AreaDeliveryModuleTableMap::DELIVERY_MODULE_ID)) {
$modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID'; $modifiedColumns[':p' . $index++] = '`DELIVERY_MODULE_ID`';
} }
if ($this->isColumnModified(AreaDeliveryModuleTableMap::CREATED_AT)) { if ($this->isColumnModified(AreaDeliveryModuleTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) { if ($this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO area_delivery_module (%s) VALUES (%s)', 'INSERT INTO `area_delivery_module` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -888,19 +888,19 @@ abstract class AreaDeliveryModule implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'AREA_ID': case '`AREA_ID`':
$stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT);
break; break;
case 'DELIVERY_MODULE_ID': case '`DELIVERY_MODULE_ID`':
$stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -147,7 +147,7 @@ abstract class AreaDeliveryModuleQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODULE_ID, CREATED_AT, UPDATED_AT FROM area_delivery_module WHERE ID = :p0'; $sql = 'SELECT `ID`, `AREA_ID`, `DELIVERY_MODULE_ID`, `CREATED_AT`, `UPDATED_AT` FROM `area_delivery_module` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -147,7 +147,7 @@ abstract class AreaQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, NAME, POSTAGE, CREATED_AT, UPDATED_AT FROM area WHERE ID = :p0'; $sql = 'SELECT `ID`, `NAME`, `POSTAGE`, `CREATED_AT`, `UPDATED_AT` FROM `area` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -961,20 +961,20 @@ abstract class Attribute implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeTableMap::ID)) { if ($this->isColumnModified(AttributeTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AttributeTableMap::POSITION)) { if ($this->isColumnModified(AttributeTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION'; $modifiedColumns[':p' . $index++] = '`POSITION`';
} }
if ($this->isColumnModified(AttributeTableMap::CREATED_AT)) { if ($this->isColumnModified(AttributeTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AttributeTableMap::UPDATED_AT)) { if ($this->isColumnModified(AttributeTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute (%s) VALUES (%s)', 'INSERT INTO `attribute` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -983,16 +983,16 @@ abstract class Attribute implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'POSITION': case '`POSITION`':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -922,23 +922,23 @@ abstract class AttributeAv implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeAvTableMap::ID)) { if ($this->isColumnModified(AttributeAvTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AttributeAvTableMap::ATTRIBUTE_ID)) { if ($this->isColumnModified(AttributeAvTableMap::ATTRIBUTE_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID'; $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`';
} }
if ($this->isColumnModified(AttributeAvTableMap::POSITION)) { if ($this->isColumnModified(AttributeAvTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION'; $modifiedColumns[':p' . $index++] = '`POSITION`';
} }
if ($this->isColumnModified(AttributeAvTableMap::CREATED_AT)) { if ($this->isColumnModified(AttributeAvTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AttributeAvTableMap::UPDATED_AT)) { if ($this->isColumnModified(AttributeAvTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute_av (%s) VALUES (%s)', 'INSERT INTO `attribute_av` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -947,19 +947,19 @@ abstract class AttributeAv implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'ATTRIBUTE_ID': case '`ATTRIBUTE_ID`':
$stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
break; break;
case 'POSITION': case '`POSITION`':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -858,26 +858,26 @@ abstract class AttributeAvI18n implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeAvI18nTableMap::ID)) { if ($this->isColumnModified(AttributeAvI18nTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AttributeAvI18nTableMap::LOCALE)) { if ($this->isColumnModified(AttributeAvI18nTableMap::LOCALE)) {
$modifiedColumns[':p' . $index++] = 'LOCALE'; $modifiedColumns[':p' . $index++] = '`LOCALE`';
} }
if ($this->isColumnModified(AttributeAvI18nTableMap::TITLE)) { if ($this->isColumnModified(AttributeAvI18nTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE'; $modifiedColumns[':p' . $index++] = '`TITLE`';
} }
if ($this->isColumnModified(AttributeAvI18nTableMap::DESCRIPTION)) { if ($this->isColumnModified(AttributeAvI18nTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION'; $modifiedColumns[':p' . $index++] = '`DESCRIPTION`';
} }
if ($this->isColumnModified(AttributeAvI18nTableMap::CHAPO)) { if ($this->isColumnModified(AttributeAvI18nTableMap::CHAPO)) {
$modifiedColumns[':p' . $index++] = 'CHAPO'; $modifiedColumns[':p' . $index++] = '`CHAPO`';
} }
if ($this->isColumnModified(AttributeAvI18nTableMap::POSTSCRIPTUM)) { if ($this->isColumnModified(AttributeAvI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute_av_i18n (%s) VALUES (%s)', 'INSERT INTO `attribute_av_i18n` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -886,22 +886,22 @@ abstract class AttributeAvI18n implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'LOCALE': case '`LOCALE`':
$stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
break; break;
case 'TITLE': case '`TITLE`':
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break; break;
case 'DESCRIPTION': case '`DESCRIPTION`':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break; break;
case 'CHAPO': case '`CHAPO`':
$stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
break; break;
case 'POSTSCRIPTUM': case '`POSTSCRIPTUM`':
$stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break; break;
} }

View File

@@ -147,7 +147,7 @@ abstract class AttributeAvI18nQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM attribute_av_i18n WHERE ID = :p0 AND LOCALE = :p1'; $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `attribute_av_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);

View File

@@ -152,7 +152,7 @@ abstract class AttributeAvQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, ATTRIBUTE_ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute_av WHERE ID = :p0'; $sql = 'SELECT `ID`, `ATTRIBUTE_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `attribute_av` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -881,23 +881,23 @@ abstract class AttributeCombination implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) { if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID'; $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`';
} }
if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_AV_ID)) { if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_AV_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_ID'; $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_AV_ID`';
} }
if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) { if ($this->isColumnModified(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID'; $modifiedColumns[':p' . $index++] = '`PRODUCT_SALE_ELEMENTS_ID`';
} }
if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) { if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AttributeCombinationTableMap::UPDATED_AT)) { if ($this->isColumnModified(AttributeCombinationTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute_combination (%s) VALUES (%s)', 'INSERT INTO `attribute_combination` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -906,19 +906,19 @@ abstract class AttributeCombination implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ATTRIBUTE_ID': case '`ATTRIBUTE_ID`':
$stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
break; break;
case 'ATTRIBUTE_AV_ID': case '`ATTRIBUTE_AV_ID`':
$stmt->bindValue($identifier, $this->attribute_av_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->attribute_av_id, PDO::PARAM_INT);
break; break;
case 'PRODUCT_SALE_ELEMENTS_ID': case '`PRODUCT_SALE_ELEMENTS_ID`':
$stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -151,7 +151,7 @@ abstract class AttributeCombinationQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ATTRIBUTE_ID, ATTRIBUTE_AV_ID, PRODUCT_SALE_ELEMENTS_ID, CREATED_AT, UPDATED_AT FROM attribute_combination WHERE ATTRIBUTE_ID = :p0 AND ATTRIBUTE_AV_ID = :p1 AND PRODUCT_SALE_ELEMENTS_ID = :p2'; $sql = 'SELECT `ATTRIBUTE_ID`, `ATTRIBUTE_AV_ID`, `PRODUCT_SALE_ELEMENTS_ID`, `CREATED_AT`, `UPDATED_AT` FROM `attribute_combination` WHERE `ATTRIBUTE_ID` = :p0 AND `ATTRIBUTE_AV_ID` = :p1 AND `PRODUCT_SALE_ELEMENTS_ID` = :p2';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);

View File

@@ -858,26 +858,26 @@ abstract class AttributeI18n implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeI18nTableMap::ID)) { if ($this->isColumnModified(AttributeI18nTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AttributeI18nTableMap::LOCALE)) { if ($this->isColumnModified(AttributeI18nTableMap::LOCALE)) {
$modifiedColumns[':p' . $index++] = 'LOCALE'; $modifiedColumns[':p' . $index++] = '`LOCALE`';
} }
if ($this->isColumnModified(AttributeI18nTableMap::TITLE)) { if ($this->isColumnModified(AttributeI18nTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE'; $modifiedColumns[':p' . $index++] = '`TITLE`';
} }
if ($this->isColumnModified(AttributeI18nTableMap::DESCRIPTION)) { if ($this->isColumnModified(AttributeI18nTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION'; $modifiedColumns[':p' . $index++] = '`DESCRIPTION`';
} }
if ($this->isColumnModified(AttributeI18nTableMap::CHAPO)) { if ($this->isColumnModified(AttributeI18nTableMap::CHAPO)) {
$modifiedColumns[':p' . $index++] = 'CHAPO'; $modifiedColumns[':p' . $index++] = '`CHAPO`';
} }
if ($this->isColumnModified(AttributeI18nTableMap::POSTSCRIPTUM)) { if ($this->isColumnModified(AttributeI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute_i18n (%s) VALUES (%s)', 'INSERT INTO `attribute_i18n` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -886,22 +886,22 @@ abstract class AttributeI18n implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'LOCALE': case '`LOCALE`':
$stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
break; break;
case 'TITLE': case '`TITLE`':
$stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
break; break;
case 'DESCRIPTION': case '`DESCRIPTION`':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break; break;
case 'CHAPO': case '`CHAPO`':
$stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR);
break; break;
case 'POSTSCRIPTUM': case '`POSTSCRIPTUM`':
$stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR);
break; break;
} }

View File

@@ -147,7 +147,7 @@ abstract class AttributeI18nQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM attribute_i18n WHERE ID = :p0 AND LOCALE = :p1'; $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `attribute_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);

View File

@@ -152,7 +152,7 @@ abstract class AttributeQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute WHERE ID = :p0'; $sql = 'SELECT `ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `attribute` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -904,26 +904,26 @@ abstract class AttributeTemplate implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AttributeTemplateTableMap::ID)) { if ($this->isColumnModified(AttributeTemplateTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_ID)) { if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_ID)) {
$modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID'; $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`';
} }
if ($this->isColumnModified(AttributeTemplateTableMap::TEMPLATE_ID)) { if ($this->isColumnModified(AttributeTemplateTableMap::TEMPLATE_ID)) {
$modifiedColumns[':p' . $index++] = 'TEMPLATE_ID'; $modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`';
} }
if ($this->isColumnModified(AttributeTemplateTableMap::POSITION)) { if ($this->isColumnModified(AttributeTemplateTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION'; $modifiedColumns[':p' . $index++] = '`POSITION`';
} }
if ($this->isColumnModified(AttributeTemplateTableMap::CREATED_AT)) { if ($this->isColumnModified(AttributeTemplateTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(AttributeTemplateTableMap::UPDATED_AT)) { if ($this->isColumnModified(AttributeTemplateTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO attribute_template (%s) VALUES (%s)', 'INSERT INTO `attribute_template` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -932,22 +932,22 @@ abstract class AttributeTemplate implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'ATTRIBUTE_ID': case '`ATTRIBUTE_ID`':
$stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
break; break;
case 'TEMPLATE_ID': case '`TEMPLATE_ID`':
$stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT);
break; break;
case 'POSITION': case '`POSITION`':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -151,7 +151,7 @@ abstract class AttributeTemplateQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, ATTRIBUTE_ID, TEMPLATE_ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute_template WHERE ID = :p0'; $sql = 'SELECT `ID`, `ATTRIBUTE_ID`, `TEMPLATE_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `attribute_template` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -1121,35 +1121,35 @@ abstract class Cart implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CartTableMap::ID)) { if ($this->isColumnModified(CartTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(CartTableMap::TOKEN)) { if ($this->isColumnModified(CartTableMap::TOKEN)) {
$modifiedColumns[':p' . $index++] = 'TOKEN'; $modifiedColumns[':p' . $index++] = '`TOKEN`';
} }
if ($this->isColumnModified(CartTableMap::CUSTOMER_ID)) { if ($this->isColumnModified(CartTableMap::CUSTOMER_ID)) {
$modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; $modifiedColumns[':p' . $index++] = '`CUSTOMER_ID`';
} }
if ($this->isColumnModified(CartTableMap::ADDRESS_DELIVERY_ID)) { if ($this->isColumnModified(CartTableMap::ADDRESS_DELIVERY_ID)) {
$modifiedColumns[':p' . $index++] = 'ADDRESS_DELIVERY_ID'; $modifiedColumns[':p' . $index++] = '`ADDRESS_DELIVERY_ID`';
} }
if ($this->isColumnModified(CartTableMap::ADDRESS_INVOICE_ID)) { if ($this->isColumnModified(CartTableMap::ADDRESS_INVOICE_ID)) {
$modifiedColumns[':p' . $index++] = 'ADDRESS_INVOICE_ID'; $modifiedColumns[':p' . $index++] = '`ADDRESS_INVOICE_ID`';
} }
if ($this->isColumnModified(CartTableMap::CURRENCY_ID)) { if ($this->isColumnModified(CartTableMap::CURRENCY_ID)) {
$modifiedColumns[':p' . $index++] = 'CURRENCY_ID'; $modifiedColumns[':p' . $index++] = '`CURRENCY_ID`';
} }
if ($this->isColumnModified(CartTableMap::DISCOUNT)) { if ($this->isColumnModified(CartTableMap::DISCOUNT)) {
$modifiedColumns[':p' . $index++] = 'DISCOUNT'; $modifiedColumns[':p' . $index++] = '`DISCOUNT`';
} }
if ($this->isColumnModified(CartTableMap::CREATED_AT)) { if ($this->isColumnModified(CartTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(CartTableMap::UPDATED_AT)) { if ($this->isColumnModified(CartTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO cart (%s) VALUES (%s)', 'INSERT INTO `cart` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1158,31 +1158,31 @@ abstract class Cart implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'TOKEN': case '`TOKEN`':
$stmt->bindValue($identifier, $this->token, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->token, PDO::PARAM_STR);
break; break;
case 'CUSTOMER_ID': case '`CUSTOMER_ID`':
$stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
break; break;
case 'ADDRESS_DELIVERY_ID': case '`ADDRESS_DELIVERY_ID`':
$stmt->bindValue($identifier, $this->address_delivery_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->address_delivery_id, PDO::PARAM_INT);
break; break;
case 'ADDRESS_INVOICE_ID': case '`ADDRESS_INVOICE_ID`':
$stmt->bindValue($identifier, $this->address_invoice_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->address_invoice_id, PDO::PARAM_INT);
break; break;
case 'CURRENCY_ID': case '`CURRENCY_ID`':
$stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT);
break; break;
case 'DISCOUNT': case '`DISCOUNT`':
$stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }

View File

@@ -109,13 +109,6 @@ abstract class CartItem implements ActiveRecordInterface
*/ */
protected $price_end_of_life; protected $price_end_of_life;
/**
* The value for the discount field.
* Note: this column has a database default value of: 0
* @var double
*/
protected $discount;
/** /**
* The value for the promo field. * The value for the promo field.
* @var int * @var int
@@ -166,7 +159,6 @@ abstract class CartItem implements ActiveRecordInterface
public function applyDefaultValues() public function applyDefaultValues()
{ {
$this->quantity = 1; $this->quantity = 1;
$this->discount = 0;
} }
/** /**
@@ -526,17 +518,6 @@ abstract class CartItem implements ActiveRecordInterface
} }
} }
/**
* Get the [discount] column value.
*
* @return double
*/
public function getDiscount()
{
return $this->discount;
}
/** /**
* Get the [promo] column value. * Get the [promo] column value.
* *
@@ -768,27 +749,6 @@ abstract class CartItem implements ActiveRecordInterface
return $this; return $this;
} // setPriceEndOfLife() } // setPriceEndOfLife()
/**
* Set the value of [discount] column.
*
* @param double $v new value
* @return \Thelia\Model\CartItem The current object (for fluent API support)
*/
public function setDiscount($v)
{
if ($v !== null) {
$v = (double) $v;
}
if ($this->discount !== $v) {
$this->discount = $v;
$this->modifiedColumns[] = CartItemTableMap::DISCOUNT;
}
return $this;
} // setDiscount()
/** /**
* Set the value of [promo] column. * Set the value of [promo] column.
* *
@@ -866,10 +826,6 @@ abstract class CartItem implements ActiveRecordInterface
return false; return false;
} }
if ($this->discount !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE // otherwise, everything was equal, so return TRUE
return true; return true;
} // hasOnlyDefaultValues() } // hasOnlyDefaultValues()
@@ -924,19 +880,16 @@ abstract class CartItem implements ActiveRecordInterface
} }
$this->price_end_of_life = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; $this->price_end_of_life = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)];
$this->discount = (null !== $col) ? (double) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CartItemTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)];
$this->promo = (null !== $col) ? (int) $col : null; $this->promo = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') { if ($col === '0000-00-00 00:00:00') {
$col = null; $col = null;
} }
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') { if ($col === '0000-00-00 00:00:00') {
$col = null; $col = null;
} }
@@ -949,7 +902,7 @@ abstract class CartItem implements ActiveRecordInterface
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 12; // 12 = CartItemTableMap::NUM_HYDRATE_COLUMNS. return $startcol + 11; // 11 = CartItemTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\CartItem object", 0, $e); throw new PropelException("Error populating \Thelia\Model\CartItem object", 0, $e);
@@ -1208,44 +1161,41 @@ abstract class CartItem implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CartItemTableMap::ID)) { if ($this->isColumnModified(CartItemTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(CartItemTableMap::CART_ID)) { if ($this->isColumnModified(CartItemTableMap::CART_ID)) {
$modifiedColumns[':p' . $index++] = 'CART_ID'; $modifiedColumns[':p' . $index++] = '`CART_ID`';
} }
if ($this->isColumnModified(CartItemTableMap::PRODUCT_ID)) { if ($this->isColumnModified(CartItemTableMap::PRODUCT_ID)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`';
} }
if ($this->isColumnModified(CartItemTableMap::QUANTITY)) { if ($this->isColumnModified(CartItemTableMap::QUANTITY)) {
$modifiedColumns[':p' . $index++] = 'QUANTITY'; $modifiedColumns[':p' . $index++] = '`QUANTITY`';
} }
if ($this->isColumnModified(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID)) { if ($this->isColumnModified(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID)) {
$modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID'; $modifiedColumns[':p' . $index++] = '`PRODUCT_SALE_ELEMENTS_ID`';
} }
if ($this->isColumnModified(CartItemTableMap::PRICE)) { if ($this->isColumnModified(CartItemTableMap::PRICE)) {
$modifiedColumns[':p' . $index++] = 'PRICE'; $modifiedColumns[':p' . $index++] = '`PRICE`';
} }
if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) { if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) {
$modifiedColumns[':p' . $index++] = 'PROMO_PRICE'; $modifiedColumns[':p' . $index++] = '`PROMO_PRICE`';
} }
if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) { if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) {
$modifiedColumns[':p' . $index++] = 'PRICE_END_OF_LIFE'; $modifiedColumns[':p' . $index++] = '`PRICE_END_OF_LIFE`';
}
if ($this->isColumnModified(CartItemTableMap::DISCOUNT)) {
$modifiedColumns[':p' . $index++] = 'DISCOUNT';
} }
if ($this->isColumnModified(CartItemTableMap::PROMO)) { if ($this->isColumnModified(CartItemTableMap::PROMO)) {
$modifiedColumns[':p' . $index++] = 'PROMO'; $modifiedColumns[':p' . $index++] = '`PROMO`';
} }
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) { if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) { if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO cart_item (%s) VALUES (%s)', 'INSERT INTO `cart_item` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1254,40 +1204,37 @@ abstract class CartItem implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'CART_ID': case '`CART_ID`':
$stmt->bindValue($identifier, $this->cart_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->cart_id, PDO::PARAM_INT);
break; break;
case 'PRODUCT_ID': case '`PRODUCT_ID`':
$stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
break; break;
case 'QUANTITY': case '`QUANTITY`':
$stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR);
break; break;
case 'PRODUCT_SALE_ELEMENTS_ID': case '`PRODUCT_SALE_ELEMENTS_ID`':
$stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT);
break; break;
case 'PRICE': case '`PRICE`':
$stmt->bindValue($identifier, $this->price, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR);
break; break;
case 'PROMO_PRICE': case '`PROMO_PRICE`':
$stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR);
break; break;
case 'PRICE_END_OF_LIFE': case '`PRICE_END_OF_LIFE`':
$stmt->bindValue($identifier, $this->price_end_of_life ? $this->price_end_of_life->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->price_end_of_life ? $this->price_end_of_life->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'DISCOUNT': case '`PROMO`':
$stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR);
break;
case 'PROMO':
$stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
} }
@@ -1377,15 +1324,12 @@ abstract class CartItem implements ActiveRecordInterface
return $this->getPriceEndOfLife(); return $this->getPriceEndOfLife();
break; break;
case 8: case 8:
return $this->getDiscount();
break;
case 9:
return $this->getPromo(); return $this->getPromo();
break; break;
case 10: case 9:
return $this->getCreatedAt(); return $this->getCreatedAt();
break; break;
case 11: case 10:
return $this->getUpdatedAt(); return $this->getUpdatedAt();
break; break;
default: default:
@@ -1425,10 +1369,9 @@ abstract class CartItem implements ActiveRecordInterface
$keys[5] => $this->getPrice(), $keys[5] => $this->getPrice(),
$keys[6] => $this->getPromoPrice(), $keys[6] => $this->getPromoPrice(),
$keys[7] => $this->getPriceEndOfLife(), $keys[7] => $this->getPriceEndOfLife(),
$keys[8] => $this->getDiscount(), $keys[8] => $this->getPromo(),
$keys[9] => $this->getPromo(), $keys[9] => $this->getCreatedAt(),
$keys[10] => $this->getCreatedAt(), $keys[10] => $this->getUpdatedAt(),
$keys[11] => $this->getUpdatedAt(),
); );
$virtualColumns = $this->virtualColumns; $virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) { foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1504,15 +1447,12 @@ abstract class CartItem implements ActiveRecordInterface
$this->setPriceEndOfLife($value); $this->setPriceEndOfLife($value);
break; break;
case 8: case 8:
$this->setDiscount($value);
break;
case 9:
$this->setPromo($value); $this->setPromo($value);
break; break;
case 10: case 9:
$this->setCreatedAt($value); $this->setCreatedAt($value);
break; break;
case 11: case 10:
$this->setUpdatedAt($value); $this->setUpdatedAt($value);
break; break;
} // switch() } // switch()
@@ -1547,10 +1487,9 @@ abstract class CartItem implements ActiveRecordInterface
if (array_key_exists($keys[5], $arr)) $this->setPrice($arr[$keys[5]]); if (array_key_exists($keys[5], $arr)) $this->setPrice($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setPromoPrice($arr[$keys[6]]); if (array_key_exists($keys[6], $arr)) $this->setPromoPrice($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setPriceEndOfLife($arr[$keys[7]]); if (array_key_exists($keys[7], $arr)) $this->setPriceEndOfLife($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDiscount($arr[$keys[8]]); if (array_key_exists($keys[8], $arr)) $this->setPromo($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setPromo($arr[$keys[9]]); if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]); if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setUpdatedAt($arr[$keys[11]]);
} }
/** /**
@@ -1570,7 +1509,6 @@ abstract class CartItem implements ActiveRecordInterface
if ($this->isColumnModified(CartItemTableMap::PRICE)) $criteria->add(CartItemTableMap::PRICE, $this->price); if ($this->isColumnModified(CartItemTableMap::PRICE)) $criteria->add(CartItemTableMap::PRICE, $this->price);
if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) $criteria->add(CartItemTableMap::PROMO_PRICE, $this->promo_price); if ($this->isColumnModified(CartItemTableMap::PROMO_PRICE)) $criteria->add(CartItemTableMap::PROMO_PRICE, $this->promo_price);
if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) $criteria->add(CartItemTableMap::PRICE_END_OF_LIFE, $this->price_end_of_life); if ($this->isColumnModified(CartItemTableMap::PRICE_END_OF_LIFE)) $criteria->add(CartItemTableMap::PRICE_END_OF_LIFE, $this->price_end_of_life);
if ($this->isColumnModified(CartItemTableMap::DISCOUNT)) $criteria->add(CartItemTableMap::DISCOUNT, $this->discount);
if ($this->isColumnModified(CartItemTableMap::PROMO)) $criteria->add(CartItemTableMap::PROMO, $this->promo); if ($this->isColumnModified(CartItemTableMap::PROMO)) $criteria->add(CartItemTableMap::PROMO, $this->promo);
if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) $criteria->add(CartItemTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) $criteria->add(CartItemTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) $criteria->add(CartItemTableMap::UPDATED_AT, $this->updated_at); if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) $criteria->add(CartItemTableMap::UPDATED_AT, $this->updated_at);
@@ -1644,7 +1582,6 @@ abstract class CartItem implements ActiveRecordInterface
$copyObj->setPrice($this->getPrice()); $copyObj->setPrice($this->getPrice());
$copyObj->setPromoPrice($this->getPromoPrice()); $copyObj->setPromoPrice($this->getPromoPrice());
$copyObj->setPriceEndOfLife($this->getPriceEndOfLife()); $copyObj->setPriceEndOfLife($this->getPriceEndOfLife());
$copyObj->setDiscount($this->getDiscount());
$copyObj->setPromo($this->getPromo()); $copyObj->setPromo($this->getPromo());
$copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -1842,7 +1779,6 @@ abstract class CartItem implements ActiveRecordInterface
$this->price = null; $this->price = null;
$this->promo_price = null; $this->promo_price = null;
$this->price_end_of_life = null; $this->price_end_of_life = null;
$this->discount = null;
$this->promo = null; $this->promo = null;
$this->created_at = null; $this->created_at = null;
$this->updated_at = null; $this->updated_at = null;

View File

@@ -29,7 +29,6 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery orderByPrice($order = Criteria::ASC) Order by the price column * @method ChildCartItemQuery orderByPrice($order = Criteria::ASC) Order by the price column
* @method ChildCartItemQuery orderByPromoPrice($order = Criteria::ASC) Order by the promo_price column * @method ChildCartItemQuery orderByPromoPrice($order = Criteria::ASC) Order by the promo_price column
* @method ChildCartItemQuery orderByPriceEndOfLife($order = Criteria::ASC) Order by the price_end_of_life column * @method ChildCartItemQuery orderByPriceEndOfLife($order = Criteria::ASC) Order by the price_end_of_life column
* @method ChildCartItemQuery orderByDiscount($order = Criteria::ASC) Order by the discount column
* @method ChildCartItemQuery orderByPromo($order = Criteria::ASC) Order by the promo column * @method ChildCartItemQuery orderByPromo($order = Criteria::ASC) Order by the promo column
* @method ChildCartItemQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildCartItemQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildCartItemQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * @method ChildCartItemQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
@@ -42,7 +41,6 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItemQuery groupByPrice() Group by the price column * @method ChildCartItemQuery groupByPrice() Group by the price column
* @method ChildCartItemQuery groupByPromoPrice() Group by the promo_price column * @method ChildCartItemQuery groupByPromoPrice() Group by the promo_price column
* @method ChildCartItemQuery groupByPriceEndOfLife() Group by the price_end_of_life column * @method ChildCartItemQuery groupByPriceEndOfLife() Group by the price_end_of_life column
* @method ChildCartItemQuery groupByDiscount() Group by the discount column
* @method ChildCartItemQuery groupByPromo() Group by the promo column * @method ChildCartItemQuery groupByPromo() Group by the promo column
* @method ChildCartItemQuery groupByCreatedAt() Group by the created_at column * @method ChildCartItemQuery groupByCreatedAt() Group by the created_at column
* @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column * @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column
@@ -74,7 +72,6 @@ use Thelia\Model\Map\CartItemTableMap;
* @method ChildCartItem findOneByPrice(double $price) Return the first ChildCartItem filtered by the price column * @method ChildCartItem findOneByPrice(double $price) Return the first ChildCartItem filtered by the price column
* @method ChildCartItem findOneByPromoPrice(double $promo_price) Return the first ChildCartItem filtered by the promo_price column * @method ChildCartItem findOneByPromoPrice(double $promo_price) Return the first ChildCartItem filtered by the promo_price column
* @method ChildCartItem findOneByPriceEndOfLife(string $price_end_of_life) Return the first ChildCartItem filtered by the price_end_of_life column * @method ChildCartItem findOneByPriceEndOfLife(string $price_end_of_life) Return the first ChildCartItem filtered by the price_end_of_life column
* @method ChildCartItem findOneByDiscount(double $discount) Return the first ChildCartItem filtered by the discount column
* @method ChildCartItem findOneByPromo(int $promo) Return the first ChildCartItem filtered by the promo column * @method ChildCartItem findOneByPromo(int $promo) Return the first ChildCartItem filtered by the promo column
* @method ChildCartItem findOneByCreatedAt(string $created_at) Return the first ChildCartItem filtered by the created_at column * @method ChildCartItem findOneByCreatedAt(string $created_at) Return the first ChildCartItem filtered by the created_at column
* @method ChildCartItem findOneByUpdatedAt(string $updated_at) Return the first ChildCartItem filtered by the updated_at column * @method ChildCartItem findOneByUpdatedAt(string $updated_at) Return the first ChildCartItem filtered by the updated_at column
@@ -87,7 +84,6 @@ use Thelia\Model\Map\CartItemTableMap;
* @method array findByPrice(double $price) Return ChildCartItem objects filtered by the price column * @method array findByPrice(double $price) Return ChildCartItem objects filtered by the price column
* @method array findByPromoPrice(double $promo_price) Return ChildCartItem objects filtered by the promo_price column * @method array findByPromoPrice(double $promo_price) Return ChildCartItem objects filtered by the promo_price column
* @method array findByPriceEndOfLife(string $price_end_of_life) Return ChildCartItem objects filtered by the price_end_of_life column * @method array findByPriceEndOfLife(string $price_end_of_life) Return ChildCartItem objects filtered by the price_end_of_life column
* @method array findByDiscount(double $discount) Return ChildCartItem objects filtered by the discount column
* @method array findByPromo(int $promo) Return ChildCartItem objects filtered by the promo column * @method array findByPromo(int $promo) Return ChildCartItem objects filtered by the promo column
* @method array findByCreatedAt(string $created_at) Return ChildCartItem objects filtered by the created_at column * @method array findByCreatedAt(string $created_at) Return ChildCartItem objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildCartItem objects filtered by the updated_at column * @method array findByUpdatedAt(string $updated_at) Return ChildCartItem objects filtered by the updated_at column
@@ -179,7 +175,7 @@ abstract class CartItemQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, CART_ID, PRODUCT_ID, QUANTITY, PRODUCT_SALE_ELEMENTS_ID, PRICE, PROMO_PRICE, PRICE_END_OF_LIFE, DISCOUNT, PROMO, CREATED_AT, UPDATED_AT FROM cart_item WHERE ID = :p0'; $sql = 'SELECT `ID`, `CART_ID`, `PRODUCT_ID`, `QUANTITY`, `PRODUCT_SALE_ELEMENTS_ID`, `PRICE`, `PROMO_PRICE`, `PRICE_END_OF_LIFE`, `PROMO`, `CREATED_AT`, `UPDATED_AT` FROM `cart_item` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -604,47 +600,6 @@ abstract class CartItemQuery extends ModelCriteria
return $this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife, $comparison); return $this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife, $comparison);
} }
/**
* Filter the query on the discount column
*
* Example usage:
* <code>
* $query->filterByDiscount(1234); // WHERE discount = 1234
* $query->filterByDiscount(array(12, 34)); // WHERE discount IN (12, 34)
* $query->filterByDiscount(array('min' => 12)); // WHERE discount > 12
* </code>
*
* @param mixed $discount 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 ChildCartItemQuery The current query, for fluid interface
*/
public function filterByDiscount($discount = null, $comparison = null)
{
if (is_array($discount)) {
$useMinMax = false;
if (isset($discount['min'])) {
$this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($discount['max'])) {
$this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CartItemTableMap::DISCOUNT, $discount, $comparison);
}
/** /**
* Filter the query on the promo column * Filter the query on the promo column
* *

View File

@@ -175,7 +175,7 @@ abstract class CartQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
$sql = 'SELECT ID, TOKEN, CUSTOMER_ID, ADDRESS_DELIVERY_ID, ADDRESS_INVOICE_ID, CURRENCY_ID, DISCOUNT, CREATED_AT, UPDATED_AT FROM cart WHERE ID = :p0'; $sql = 'SELECT `ID`, `TOKEN`, `CUSTOMER_ID`, `ADDRESS_DELIVERY_ID`, `ADDRESS_INVOICE_ID`, `CURRENCY_ID`, `DISCOUNT`, `CREATED_AT`, `UPDATED_AT` FROM `cart` WHERE `ID` = :p0';
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);

View File

@@ -1283,35 +1283,35 @@ abstract class Category implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CategoryTableMap::ID)) { if ($this->isColumnModified(CategoryTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID'; $modifiedColumns[':p' . $index++] = '`ID`';
} }
if ($this->isColumnModified(CategoryTableMap::PARENT)) { if ($this->isColumnModified(CategoryTableMap::PARENT)) {
$modifiedColumns[':p' . $index++] = 'PARENT'; $modifiedColumns[':p' . $index++] = '`PARENT`';
} }
if ($this->isColumnModified(CategoryTableMap::VISIBLE)) { if ($this->isColumnModified(CategoryTableMap::VISIBLE)) {
$modifiedColumns[':p' . $index++] = 'VISIBLE'; $modifiedColumns[':p' . $index++] = '`VISIBLE`';
} }
if ($this->isColumnModified(CategoryTableMap::POSITION)) { if ($this->isColumnModified(CategoryTableMap::POSITION)) {
$modifiedColumns[':p' . $index++] = 'POSITION'; $modifiedColumns[':p' . $index++] = '`POSITION`';
} }
if ($this->isColumnModified(CategoryTableMap::CREATED_AT)) { if ($this->isColumnModified(CategoryTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT'; $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
} }
if ($this->isColumnModified(CategoryTableMap::UPDATED_AT)) { if ($this->isColumnModified(CategoryTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT'; $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
} }
if ($this->isColumnModified(CategoryTableMap::VERSION)) { if ($this->isColumnModified(CategoryTableMap::VERSION)) {
$modifiedColumns[':p' . $index++] = 'VERSION'; $modifiedColumns[':p' . $index++] = '`VERSION`';
} }
if ($this->isColumnModified(CategoryTableMap::VERSION_CREATED_AT)) { if ($this->isColumnModified(CategoryTableMap::VERSION_CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`';
} }
if ($this->isColumnModified(CategoryTableMap::VERSION_CREATED_BY)) { if ($this->isColumnModified(CategoryTableMap::VERSION_CREATED_BY)) {
$modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`';
} }
$sql = sprintf( $sql = sprintf(
'INSERT INTO category (%s) VALUES (%s)', 'INSERT INTO `category` (%s) VALUES (%s)',
implode(', ', $modifiedColumns), implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns)) implode(', ', array_keys($modifiedColumns))
); );
@@ -1320,31 +1320,31 @@ abstract class Category implements ActiveRecordInterface
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
foreach ($modifiedColumns as $identifier => $columnName) { foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) { switch ($columnName) {
case 'ID': case '`ID`':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break; break;
case 'PARENT': case '`PARENT`':
$stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT);
break; break;
case 'VISIBLE': case '`VISIBLE`':
$stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
break; break;
case 'POSITION': case '`POSITION`':
$stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
break; break;
case 'CREATED_AT': case '`CREATED_AT`':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'UPDATED_AT': case '`UPDATED_AT`':
$stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'VERSION': case '`VERSION`':
$stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
break; break;
case 'VERSION_CREATED_AT': case '`VERSION_CREATED_AT`':
$stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break; break;
case 'VERSION_CREATED_BY': case '`VERSION_CREATED_BY`':
$stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
break; break;
} }

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