diff --git a/Readme.md b/Readme.md index abb8ccd30..fe90c50cc 100755 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,7 @@ Requirements * gd * curl * safe_mode off - * memory_limit at least 128M, preferably 256. + * memory_limit at least 150M, preferably 256. * post_max_size 20M * upload_max_filesize 2M * apache 2 @@ -44,8 +44,10 @@ Installation ------------ ``` bash +$ git clone https://github.com/thelia/thelia.git +$ cd thelia $ curl -sS https://getcomposer.org/installer | php -$ php composer.phar create-project thelia/thelia path/ dev-master +$ php composer.phar install --prefer-dist --optimize-autoloader ``` Finish the installation using cli tools : @@ -56,14 +58,6 @@ $ php Thelia thelia:install You just have to follow all instructions. -Documentation -------------- - -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. - - Contribute ---------- diff --git a/core/lib/Thelia/Action/BaseAction.php b/core/lib/Thelia/Action/BaseAction.php index c376a78b7..1f04e12f6 100755 --- a/core/lib/Thelia/Action/BaseAction.php +++ b/core/lib/Thelia/Action/BaseAction.php @@ -30,6 +30,7 @@ use Thelia\Core\Event\UpdateSeoEvent; use Thelia\Exception\UrlRewritingException; use Thelia\Form\Exception\FormValidationException; +use \Thelia\Model\Tools\UrlRewritingTrait; class BaseAction { @@ -81,8 +82,8 @@ class BaseAction /** * Changes SEO Fields for an object. * - * @param ModelCriteria $query - * @param UpdateSeoEvent $event + * @param ModelCriteria $query + * @param UpdateSeoEvent $event * * @return mixed */ @@ -104,7 +105,7 @@ class BaseAction // Update the rewritten URL, if required try { $object->setRewrittenUrl($event->getLocale(), $event->getUrl()); - } catch (UrlRewritingException $e) { + } catch(UrlRewritingException $e) { throw new FormValidationException($e->getMessage(), $e->getCode()); } diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 4c76002ac..1b77eb488 100755 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -28,7 +28,6 @@ use Thelia\Condition\ConditionFactory; use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Core\Event\Coupon\CouponConsumeEvent; use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent; -use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\HttpFoundation\Request; use Thelia\Coupon\CouponFactory; @@ -37,7 +36,6 @@ use Thelia\Condition\ConditionCollection; use Thelia\Coupon\Type\CouponInterface; use Thelia\Model\Coupon as CouponModel; use Thelia\Model\CouponQuery; -use Thelia\Model\OrderCoupon; /** * Created by JetBrains PhpStorm. @@ -124,20 +122,23 @@ class Coupon extends BaseAction implements EventSubscriberInterface $request->getSession()->setConsumedCoupons($consumedCoupons); $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 ->getSession() ->getCart() ->setDiscount($totalDiscount) ->save(); - $request - ->getSession() - ->getOrder() - ->setDiscount($totalDiscount) - ->save(); } } + $event->setIsValid($isValid); $event->setDiscount($totalDiscount); } @@ -206,68 +207,6 @@ class Coupon extends BaseAction implements EventSubscriberInterface $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. * @@ -294,9 +233,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface TheliaEvents::COUPON_CREATE => array("create", 128), TheliaEvents::COUPON_UPDATE => array("update", 128), TheliaEvents::COUPON_CONSUME => array("consume", 128), - TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128), - TheliaEvents::ORDER_SET_POSTAGE => array("testFreePostage", 256), - TheliaEvents::ORDER_BEFORE_PAYMENT => array("afterOrder", 128), + TheliaEvents::COUPON_CONDITION_UPDATE => array("updateCondition", 128) ); } } diff --git a/core/lib/Thelia/Action/MailingSystem.php b/core/lib/Thelia/Action/MailingSystem.php index 2f62d749b..f46352d53 100644 --- a/core/lib/Thelia/Action/MailingSystem.php +++ b/core/lib/Thelia/Action/MailingSystem.php @@ -35,7 +35,7 @@ class MailingSystem extends BaseAction implements EventSubscriberInterface */ public function update(MailingSystemEvent $event) { - if ($event->getEnabled()) { + if($event->getEnabled()) { ConfigQuery::enableSmtp(); } else { ConfigQuery::disableSmtp(); diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php index 9d7daaba7..0699c14d1 100755 --- a/core/lib/Thelia/Action/Order.php +++ b/core/lib/Thelia/Action/Order.php @@ -30,7 +30,6 @@ use Thelia\Core\Event\Cart\CartEvent; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Coupon\CouponManager; use Thelia\Exception\TheliaProcessException; use Thelia\Model\AddressQuery; use Thelia\Model\ConfigQuery; @@ -74,17 +73,6 @@ class Order extends BaseAction implements EventSubscriberInterface $order = $event->getOrder(); $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()); $event->setOrder($order); @@ -190,11 +178,6 @@ class Order extends BaseAction implements EventSubscriberInterface OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_NOT_PAID)->getId() ); - /* memorize discount */ - $placedOrder->setDiscount( - $cart->getDiscount() - ); - $placedOrder->save($con); /* fulfill order_products and decrease stock */ @@ -279,6 +262,8 @@ class Order extends BaseAction implements EventSubscriberInterface } } + /* discount @todo */ + $con->commit(); $this->getDispatcher()->dispatch(TheliaEvents::ORDER_BEFORE_PAYMENT, new OrderEvent($placedOrder)); @@ -288,7 +273,7 @@ class Order extends BaseAction implements EventSubscriberInterface $sessionOrder = new \Thelia\Model\Order(); $event->setOrder($sessionOrder); $event->setPlacedOrder($placedOrder); - $this->getSession()->setOrder($placedOrder); + $this->getSession()->setOrder($sessionOrder); /* empty cart */ $this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest()))); @@ -305,7 +290,7 @@ class Order extends BaseAction implements EventSubscriberInterface { $contact_email = ConfigQuery::read('contact_email'); - if ($contact_email) { + if($contact_email) { $message = MessageQuery::create() ->filterByName('order_confirmation') @@ -427,7 +412,6 @@ class Order extends BaseAction implements EventSubscriberInterface return array( TheliaEvents::ORDER_SET_DELIVERY_ADDRESS => array("setDeliveryAddress", 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_PAYMENT_MODULE => array("setPaymentModule", 128), TheliaEvents::ORDER_PAY => array("create", 128), diff --git a/core/lib/Thelia/Action/Product.php b/core/lib/Thelia/Action/Product.php index a5defe5cb..6d477855b 100644 --- a/core/lib/Thelia/Action/Product.php +++ b/core/lib/Thelia/Action/Product.php @@ -131,6 +131,7 @@ class Product extends BaseAction implements EventSubscriberInterface return $this->genericUpdateSeo(ProductQuery::create(), $event); } + /** * Delete a product entry * diff --git a/core/lib/Thelia/Action/ProductSaleElement.php b/core/lib/Thelia/Action/ProductSaleElement.php index 875dbcc1d..cad3be374 100644 --- a/core/lib/Thelia/Action/ProductSaleElement.php +++ b/core/lib/Thelia/Action/ProductSaleElement.php @@ -209,7 +209,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface if ($product->countSaleElements() <= 0) { // If we just deleted the last PSE, create a default one $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 $pse = ProductSaleElementsQuery::create() @@ -237,8 +238,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface * * @param ProductCombinationGenerationEvent $event */ - public function generateCombinations(ProductCombinationGenerationEvent $event) - { + public function generateCombinations(ProductCombinationGenerationEvent $event) { + $con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME); $con->beginTransaction(); @@ -251,7 +252,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface $isDefault = true; // Create all combinations - foreach ($event->getCombinations() as $combinationAttributesAvIds) { + foreach($event->getCombinations() as $combinationAttributesAvIds) { // Create the PSE $saleElement = $event->getProduct()->createProductSaleElement( @@ -275,7 +276,8 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface // Store all the stuff ! $con->commit(); - } catch (\Exception $ex) { + } + catch (\Exception $ex) { $con->rollback(); @@ -286,9 +288,9 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface /** * Create a combination for a given product sale element * - * @param ConnectionInterface $con the Propel connection - * @param ProductSaleElement $salesElement the product sale element - * @param unknown $combinationAttributes an array oif attributes av IDs + * @param ConnectionInterface $con the Propel connection + * @param ProductSaleElement $salesElement the product sale element + * @param unknown $combinationAttributes an array oif attributes av IDs */ protected function createCombination(ConnectionInterface $con, ProductSaleElements $salesElement, $combinationAttributes) { diff --git a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php index 690f4362b..cab25d13f 100644 --- a/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php +++ b/core/lib/Thelia/Command/AdminUpdatePasswordCommand.php @@ -32,6 +32,7 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\AdminQuery; use Thelia\Tools\Password; + /** * command line for updating admin password * @@ -71,15 +72,18 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand { $login = $input->getArgument('login'); + if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) { throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login)); } + $password = $input->getOption('password') ?: Password::generateRandom(); $event = new AdministratorUpdatePasswordEvent($admin); $event->setPassword($password); + $this-> getContainer() ->get('event_dispatcher') @@ -95,3 +99,4 @@ class AdminUpdatePasswordCommand extends ContainerAwareCommand } } + diff --git a/core/lib/Thelia/Config/I18n/en_US.php b/core/lib/Thelia/Config/I18n/en_US.php index 2b8b661c2..ce333ddb4 100644 --- a/core/lib/Thelia/Config/I18n/en_US.php +++ b/core/lib/Thelia/Config/I18n/en_US.php @@ -1,14 +1,14 @@ 'Delivery module', - 'Quantity' => 'Quantity', - 'Product' => 'Product', - 'Unit. price' => 'Unit. price', - 'Tax' => 'Tax', - 'Unit taxed price' => 'Unit taxed price', - 'Taxed total' => 'Taxed total', - 'Payment module' => 'Payment module', - 'Postage' => 'Postage', - 'Total' => 'Total', + 'Delivery module' => 'Delivery module', + 'Quantity' => 'Quantity', + 'Product' => 'Product', + 'Unit. price' => 'Unit. price', + 'Tax' => 'Tax', + 'Unit taxed price' => 'Unit taxed price', + 'Taxed total' => 'Taxed total', + 'Payment module' => 'Payment module', + 'Postage' => 'Postage', + 'Total' => 'Total', ); diff --git a/core/lib/Thelia/Config/I18n/es_ES.php b/core/lib/Thelia/Config/I18n/es_ES.php index 0a749d4c1..f1a85bd6a 100644 --- a/core/lib/Thelia/Config/I18n/es_ES.php +++ b/core/lib/Thelia/Config/I18n/es_ES.php @@ -1,36 +1,36 @@ 'Combination builder', - 'Title' => 'Title', - 'City' => 'City', - 'Zip code' => 'Zip code', - 'Country' => 'Country', - 'Phone' => 'Phone', - 'Login' => 'Login', - 'Password' => 'Password', - 'Profile' => 'Profile', - 'Postage' => 'Postage', - 'Add to all product templates' => 'Add to all product templates', - 'Quantity' => 'Quantity', - 'Name' => 'Name', - 'Value' => 'Value', - 'Subject' => 'Subject', - 'Company' => 'Company', - 'Description' => 'Description', - 'Language name' => 'Language name', - 'ISO 639 Code' => 'ISO 639 Code', - 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :', - 'Host' => 'Host', - 'Port' => 'Port', - 'Encryption' => 'Encryption', - 'Username' => 'Username', - 'Timeout' => 'Timeout', - 'Source IP' => 'Source IP', - 'Email address' => 'Email address', - 'Firstname' => 'Firstname', - 'Lastname' => 'Lastname', - 'Additional address' => 'Additional address', - 'Reference' => 'Reference', - 'EAN Code' => 'EAN Code', + 'Combination builder' => 'Combination builder', + 'Title' => 'Title', + 'City' => 'City', + 'Zip code' => 'Zip code', + 'Country' => 'Country', + 'Phone' => 'Phone', + 'Login' => 'Login', + 'Password' => 'Password', + 'Profile' => 'Profile', + 'Postage' => 'Postage', + 'Add to all product templates' => 'Add to all product templates', + 'Quantity' => 'Quantity', + 'Name' => 'Name', + 'Value' => 'Value', + 'Subject' => 'Subject', + 'Company' => 'Company', + 'Description' => 'Description', + 'Language name' => 'Language name', + 'ISO 639 Code' => 'ISO 639 Code', + 'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :', + 'Host' => 'Host', + 'Port' => 'Port', + 'Encryption' => 'Encryption', + 'Username' => 'Username', + 'Timeout' => 'Timeout', + 'Source IP' => 'Source IP', + 'Email address' => 'Email address', + 'Firstname' => 'Firstname', + 'Lastname' => 'Lastname', + 'Additional address' => 'Additional address', + 'Reference' => 'Reference', + 'EAN Code' => 'EAN Code', ); diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php index 188d6f90a..7eb24949a 100644 --- a/core/lib/Thelia/Config/I18n/fr_FR.php +++ b/core/lib/Thelia/Config/I18n/fr_FR.php @@ -23,4 +23,4 @@ return array( -); +); \ No newline at end of file diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php index 188d6f90a..7eb24949a 100644 --- a/core/lib/Thelia/Config/I18n/it_IT.php +++ b/core/lib/Thelia/Config/I18n/it_IT.php @@ -23,4 +23,4 @@ return array( -); +); \ No newline at end of file diff --git a/core/lib/Thelia/Config/Resources/loop.xml b/core/lib/Thelia/Config/Resources/loop.xml index 0e5414ad8..c253b5fb4 100644 --- a/core/lib/Thelia/Config/Resources/loop.xml +++ b/core/lib/Thelia/Config/Resources/loop.xml @@ -28,7 +28,6 @@ - diff --git a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php index 7e3f936fc..028d5ab15 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractCrudController.php @@ -443,6 +443,7 @@ abstract class AbstractCrudController extends BaseAdminController $ex ); + //return $this->renderEditionTemplate(); } diff --git a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php index 52c4bbda4..9918f8a2f 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php @@ -53,7 +53,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController * * @param string $visibilityToggleEventIdentifier the dispatched visibility toggle TheliaEvent identifier, or null if the object has no visible options. Example: TheliaEvents::MESSAGE_TOGGLE_VISIBILITY * @param string $changePositionEventIdentifier the dispatched position change TheliaEvent identifier, or null if the object has no position. Example: TheliaEvents::MESSAGE_UPDATE_POSITION - * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO + * @param string $updateSeoEventIdentifier the dispatched update SEO change TheliaEvent identifier, or null if the object has no SEO. Example: TheliaEvents::MESSAGE_UPDATE_SEO */ public function __construct( $objectName, @@ -134,8 +134,7 @@ abstract class AbstractSeoCrudController extends AbstractCrudController * * @param unknown $object */ - protected function hydrateSeoForm($object) - { + protected function hydrateSeoForm($object){ // The "SEO" tab form $locale = $object->getLocale(); $data = array( @@ -228,6 +227,8 @@ abstract class AbstractSeoCrudController extends AbstractCrudController $ex ); + + // At this point, the form has errors, and should be redisplayed. return $this->renderEditionTemplate(); } diff --git a/core/lib/Thelia/Controller/Admin/AddressController.php b/core/lib/Thelia/Controller/Admin/AddressController.php index c818ba492..3e2812bd0 100644 --- a/core/lib/Thelia/Controller/Admin/AddressController.php +++ b/core/lib/Thelia/Controller/Admin/AddressController.php @@ -98,7 +98,7 @@ class AddressController extends AbstractCrudController /** * Fills in the form data array * - * @param unknown $object + * @param unknown $object * @return multitype:NULL */ protected function createFormDataArray($object) @@ -309,8 +309,7 @@ class AddressController extends AbstractCrudController $this->redirectToEditionTemplate(); } - protected function getCustomerId() - { + protected function getCustomerId() { if (null !== $address = $this->getExistingObject()) return $address->getCustomerId(); else diff --git a/core/lib/Thelia/Controller/Admin/AttributeController.php b/core/lib/Thelia/Controller/Admin/AttributeController.php index b058f060d..ce1ca3072 100644 --- a/core/lib/Thelia/Controller/Admin/AttributeController.php +++ b/core/lib/Thelia/Controller/Admin/AttributeController.php @@ -34,6 +34,7 @@ use Thelia\Form\AttributeModificationForm; use Thelia\Form\AttributeCreationForm; use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Model\AttributeAv; +use Thelia\Model\AttributeAvQuery; use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent; use Thelia\Core\Event\Attribute\AttributeEvent; diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 1ef329dd1..abb9665f9 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -309,7 +309,6 @@ class BaseAdminController extends BaseController { // Check if the functionality is activated if(!ConfigQuery::read("one_domain_foreach_lang", false)) - return; // If we don't have a locale value, use the locale value in the session @@ -391,8 +390,8 @@ class BaseAdminController extends BaseController * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php index d2e0a0e9c..4f789244b 100755 --- a/core/lib/Thelia/Controller/Admin/CategoryController.php +++ b/core/lib/Thelia/Controller/Admin/CategoryController.php @@ -201,12 +201,15 @@ class CategoryController extends AbstractSeoCrudController protected function redirectToListTemplateWithId($category_id) { - if ($category_id > 0) { + if($category_id > 0) + { $this->redirectToRoute( 'admin.categories.default', array('category_id' => $category_id) ); - } else { + } + else + { $this->redirectToRoute( 'admin.catalog' ); diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index 95d425edb..1a9172ec1 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -23,9 +23,11 @@ namespace Thelia\Controller\Admin; + use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; use Thelia\Form\ConfigStoreForm; +use Thelia\Log\Tlog; use Thelia\Model\ConfigQuery; /** * Class ConfigStoreController @@ -78,7 +80,7 @@ class ConfigStoreController extends BaseAdminController $data = $form->getData(); // Update store - foreach ($data as $name => $value) { + foreach($data as $name => $value) { if(! in_array($name , array('success_url', 'error_message'))) ConfigQuery::write($name, $value, false); } diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php index 95f6451c9..a3239542c 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerController.php @@ -23,14 +23,19 @@ namespace Thelia\Controller\Admin; +use Propel\Runtime\Exception\PropelException; use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerEvent; use Thelia\Core\Event\TheliaEvents; +use Thelia\Core\Security\AccessManager; use Thelia\Form\CustomerCreateForm; use Thelia\Form\CustomerUpdateForm; +use Thelia\Form\Exception\FormValidationException; use Thelia\Model\CustomerQuery; +use Thelia\Core\Translation\Translator; use Thelia\Tools\Password; +use Thelia\Model\AddressQuery; use Thelia\Model\Address; /** @@ -203,4 +208,4 @@ class CustomerController extends AbstractCrudController { $this->redirectToRoute("admin.customer.update.view", $this->getEditionArguments()); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Controller/Admin/FeatureController.php b/core/lib/Thelia/Controller/Admin/FeatureController.php index 5ae0aae7d..8ff3a972e 100644 --- a/core/lib/Thelia/Controller/Admin/FeatureController.php +++ b/core/lib/Thelia/Controller/Admin/FeatureController.php @@ -34,6 +34,7 @@ use Thelia\Form\FeatureModificationForm; use Thelia\Form\FeatureCreationForm; use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Model\FeatureAv; +use Thelia\Model\FeatureAvQuery; use Thelia\Core\Event\Feature\FeatureAvUpdateEvent; use Thelia\Core\Event\Feature\FeatureEvent; diff --git a/core/lib/Thelia/Controller/Admin/FileController.php b/core/lib/Thelia/Controller/Admin/FileController.php index f123bfb94..aff1c2d63 100755 --- a/core/lib/Thelia/Controller/Admin/FileController.php +++ b/core/lib/Thelia/Controller/Admin/FileController.php @@ -584,7 +584,7 @@ class FileController extends BaseAdminController ); } - if (null === $message) { + if(null === $message) { $message = $this->getTranslator() ->trans( 'Images deleted successfully', @@ -638,7 +638,7 @@ class FileController extends BaseAdminController ) . $e->getMessage(); } - if (null === $message) { + if(null === $message) { $message = $this->getTranslator() ->trans( 'Image position updated', @@ -692,7 +692,7 @@ class FileController extends BaseAdminController ) . $e->getMessage(); } - if (null === $message) { + if(null === $message) { $message = $this->getTranslator() ->trans( 'Document position updated', diff --git a/core/lib/Thelia/Controller/Admin/HomeController.php b/core/lib/Thelia/Controller/Admin/HomeController.php index d4458843d..0fcee29ca 100644 --- a/core/lib/Thelia/Controller/Admin/HomeController.php +++ b/core/lib/Thelia/Controller/Admin/HomeController.php @@ -42,7 +42,7 @@ class HomeController extends BaseAdminController public function loadStatsAjaxAction() { if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW)) return $response; - + $data = new \stdClass(); $data->title = "Stats on " . $this->getRequest()->query->get('month', date('m')) . "/" . $this->getRequest()->query->get('year', date('Y')); @@ -88,6 +88,7 @@ class HomeController extends BaseAdminController array(5) ); + $data->series = array( $saleSeries, $newCustomerSeries, diff --git a/core/lib/Thelia/Controller/Admin/MessageController.php b/core/lib/Thelia/Controller/Admin/MessageController.php index aebf29d04..fe8b655c7 100644 --- a/core/lib/Thelia/Controller/Admin/MessageController.php +++ b/core/lib/Thelia/Controller/Admin/MessageController.php @@ -31,6 +31,7 @@ use Thelia\Model\MessageQuery; use Thelia\Form\MessageModificationForm; use Thelia\Form\MessageCreationForm; use Symfony\Component\Finder\Finder; +use Thelia\Model\ConfigQuery; use Thelia\Core\Template\TemplateHelper; /** @@ -163,8 +164,8 @@ class MessageController extends AbstractCrudController return $this->render('messages'); } - protected function listDirectoryContent($requiredExtension) - { + protected function listDirectoryContent($requiredExtension) { + $list = array(); $dir = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath(); diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php index edd591ba4..031ae1f26 100644 --- a/core/lib/Thelia/Controller/Admin/ModuleController.php +++ b/core/lib/Thelia/Controller/Admin/ModuleController.php @@ -149,6 +149,7 @@ class ModuleController extends AbstractCrudController ->findOneById($this->getRequest()->get('module_id')); } + protected function getObjectLabel($object) { return $object->getTitle(); @@ -217,11 +218,12 @@ class ModuleController extends AbstractCrudController { $module = ModuleQuery::create()->findOneByCode($module_code); - if (null === $module) { + if(null === $module) { throw new \InvalidArgumentException(sprintf("Module `%s` does not exists", $module_code)); } if (null !== $response = $this->checkAuth(array(), $module_code, AccessManager::VIEW)) return $response; + return $this->render( "module-configure", array( diff --git a/core/lib/Thelia/Controller/Admin/OrderController.php b/core/lib/Thelia/Controller/Admin/OrderController.php index c04e2c93e..56d130f5d 100644 --- a/core/lib/Thelia/Controller/Admin/OrderController.php +++ b/core/lib/Thelia/Controller/Admin/OrderController.php @@ -27,6 +27,7 @@ use Thelia\Core\HttpFoundation\Response; use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; +use Thelia\Core\Event\PdfEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Security\AccessManager; use Thelia\Form\OrderUpdateAddress; @@ -35,6 +36,7 @@ use Thelia\Model\Base\OrderAddressQuery; use Thelia\Model\OrderQuery; use Thelia\Model\OrderStatusQuery; use Thelia\Tools\URL; +use Thelia\Core\Template\TemplateHelper; /** * Class OrderController @@ -201,18 +203,20 @@ class OrderController extends BaseAdminController public function generateInvoicePdf($order_id) { if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; + return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_invoice_file', 'invoice')); } public function generateDeliveryPdf($order_id) { if (null !== $response = $this->checkAuth(AdminResources::ORDER, array(), AccessManager::UPDATE)) return $response; + return $this->generateBackOfficeOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery')); } private function generateBackOfficeOrderPdf($order_id, $fileName) { - if (null === $response = $this->generateOrderPdf($order_id, $fileName)) { + if(null === $response = $this->generateOrderPdf($order_id, $fileName)){ $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute("admin.order.update.view", array( 'order_id' => $order_id )))); @@ -221,4 +225,5 @@ class OrderController extends BaseAdminController return $response; } + } diff --git a/core/lib/Thelia/Controller/Admin/ProductController.php b/core/lib/Thelia/Controller/Admin/ProductController.php index 7b727f206..57ceb8fb4 100644 --- a/core/lib/Thelia/Controller/Admin/ProductController.php +++ b/core/lib/Thelia/Controller/Admin/ProductController.php @@ -72,6 +72,7 @@ use Thelia\Form\ProductCombinationGenerationForm; use Thelia\TaxEngine\Calculator; use Thelia\Tools\NumberFormat; + /** * Manages products * @@ -1036,18 +1037,17 @@ class ProductController extends AbstractSeoCrudController } // Create combinations - protected function combine($input, &$output, &$tmp) - { + protected function combine($input, &$output, &$tmp) { $current = array_shift($input); if (count($input) > 0) { - foreach ($current as $element) { + foreach($current as $element) { $tmp[] = $element; $this->combine($input, $output, $tmp); array_pop($tmp); } } else { - foreach ($current as $element) { + foreach($current as $element) { $tmp[] = $element; $output[] = $tmp; array_pop($tmp); @@ -1058,8 +1058,8 @@ class ProductController extends AbstractSeoCrudController /** * Build combinations from the combination output builder */ - public function buildCombinationsAction() - { + public function buildCombinationsAction() { + // Check current user authorization if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) return $response; @@ -1082,7 +1082,7 @@ class ProductController extends AbstractSeoCrudController // from the list of attribute_id:attributes_av ID from the form. $combinations = $attributes_av_list = array(); - foreach ($data['attribute_av'] as $item) { + foreach($data['attribute_av'] as $item) { list($attribute_id, $attribute_av_id) = explode(':', $item); if (! isset($attributes_av_list[$attribute_id])) diff --git a/core/lib/Thelia/Controller/Admin/SystemLogController.php b/core/lib/Thelia/Controller/Admin/SystemLogController.php index 9dafd78f6..e61d619f0 100644 --- a/core/lib/Thelia/Controller/Admin/SystemLogController.php +++ b/core/lib/Thelia/Controller/Admin/SystemLogController.php @@ -23,6 +23,7 @@ namespace Thelia\Controller\Admin; + use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; use Thelia\Form\SystemLogConfigurationForm; @@ -42,7 +43,7 @@ class SystemLogController extends BaseAdminController $destination_directories = Tlog::getInstance()->getDestinationsDirectories(); - foreach ($destination_directories as $dir) { + foreach($destination_directories as $dir) { $this->loadDefinedDestinations($dir, $destinations); } @@ -57,8 +58,8 @@ class SystemLogController extends BaseAdminController ); } - protected function loadDefinedDestinations($directory, &$destinations) - { + protected function loadDefinedDestinations($directory, &$destinations) { + try { foreach (new \DirectoryIterator($directory) as $fileInfo) { @@ -143,7 +144,7 @@ class SystemLogController extends BaseAdminController $active_destinations = array(); - foreach ($destinations as $classname => $destination) { + foreach($destinations as $classname => $destination) { if (isset($destination['active'])) { $active_destinations[] = $destination['classname']; @@ -152,7 +153,7 @@ class SystemLogController extends BaseAdminController if (isset($configs[$classname])) { // Update destinations configuration - foreach ($configs[$classname] as $var => $value) { + foreach($configs[$classname] as $var => $value) { ConfigQuery::write($var, $value, true, true); } } diff --git a/core/lib/Thelia/Controller/Admin/TranslationsController.php b/core/lib/Thelia/Controller/Admin/TranslationsController.php index e4fcfed23..cb7c3f072 100644 --- a/core/lib/Thelia/Controller/Admin/TranslationsController.php +++ b/core/lib/Thelia/Controller/Admin/TranslationsController.php @@ -23,8 +23,12 @@ namespace Thelia\Controller\Admin; + use Thelia\Core\Security\Resource\AdminResources; use Thelia\Core\Security\AccessManager; +use Thelia\Form\SystemLogConfigurationForm; +use Thelia\Log\Tlog; +use Thelia\Model\ConfigQuery; use Thelia\Model\ModuleQuery; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -63,7 +67,7 @@ class TranslationsController extends BaseAdminController if (! empty($item_id) || $item_to_translate == 'co') { - switch ($item_to_translate) { + switch($item_to_translate) { case 'mo' : if (null !== $module = ModuleQuery::create()->findPk($item_id)) { @@ -145,7 +149,8 @@ class TranslationsController extends BaseAdminController $templateArguments['max_input_vars_warning'] = true; $templateArguments['required_max_input_vars'] = $stringsCount; $templateArguments['current_max_input_vars'] = ini_get('max_input_vars'); - } else { + } + else { $templateArguments['all_strings'] = $all_strings; } } @@ -157,12 +162,14 @@ class TranslationsController extends BaseAdminController public function defaultAction() { if (null !== $response = $this->checkAuth(AdminResources::TRANSLATIONS, array(), AccessManager::VIEW)) return $response; + return $this->renderTemplate(); } public function updateAction() { if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, array(), AccessManager::UPDATE)) return $response; + return $this->renderTemplate(); } } diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index b90d98462..775861c32 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -61,7 +61,7 @@ abstract class BaseController extends ContainerAware /** * Return an empty response (after an ajax request, for example) - * @param int $status + * @param int $status * @return \Thelia\Core\HttpFoundation\Response */ protected function nullResponse($status = 200) @@ -252,6 +252,7 @@ abstract class BaseController extends ContainerAware } + } /** @@ -366,8 +367,8 @@ abstract class BaseController extends ContainerAware * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ abstract protected function render($templateName, $args = array(), $status = 200); diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index 3e70364d4..07f434099 100755 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -25,8 +25,10 @@ namespace Thelia\Controller\Front; use Symfony\Component\Routing\Router; use Thelia\Controller\BaseController; use Thelia\Core\HttpFoundation\Response; +use Thelia\Core\Security\Exception\AuthenticationException; use Thelia\Core\Template\TemplateHelper; use Thelia\Model\AddressQuery; +use Thelia\Model\ConfigQuery; use Thelia\Model\ModuleQuery; use Thelia\Tools\Redirect; use Thelia\Tools\URL; @@ -104,8 +106,8 @@ class BaseFrontController extends BaseController * Render the given template, and returns the result as an Http Response. * * @param $templateName the complete template name, with extension - * @param array $args the template arguments - * @param int $status http code status + * @param array $args the template arguments + * @param int $status http code status * @return \Thelia\Core\HttpFoundation\Response */ protected function render($templateName, $args = array(), $status = 200) diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php index 43f84ebd5..e007f9961 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/TranslatorPass.php @@ -26,6 +26,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; + /** * Class TranslatorPass * @package Thelia\Core\DependencyInjection\Compiler @@ -49,11 +50,11 @@ class TranslatorPass implements CompilerPassInterface $translator = $container->getDefinition('thelia.translator'); - foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) { + foreach($container->findTaggedServiceIds('translation.loader') as $id => $attributes) { $translator->addMethodCall('addLoader', array($attributes[0]['alias'], new Reference($id))); if (isset($attributes[0]['legacy-alias'])) { $translator->addMethodCall('addLoader', array($attributes[0]['legacy-alias'], new Reference($id))); } } } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php index 8cfe1ee02..f155a9dce 100644 --- a/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php +++ b/core/lib/Thelia/Core/Event/Administrator/AdministratorUpdatePasswordEvent.php @@ -25,6 +25,7 @@ namespace Thelia\Core\Event\Administrator; use Thelia\Core\Event\ActionEvent; use Thelia\Model\Admin; + /** * Class AdministratorUpdatePasswordEvent * @package Thelia\Core\Event\Administrator @@ -81,3 +82,4 @@ class AdministratorUpdatePasswordEvent extends ActionEvent } } + diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php index f35430c36..2c45942f3 100755 --- a/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerCreateOrUpdateEvent.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Event\Customer; use Symfony\Component\EventDispatcher\Event; +use Thelia\Core\Event\ActionEvent; use Thelia\Model\Customer; /** diff --git a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php index 943eb5b64..0a046177e 100755 --- a/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php +++ b/core/lib/Thelia/Core/Event/Customer/CustomerLoginEvent.php @@ -23,6 +23,7 @@ namespace Thelia\Core\Event\Customer; +use Thelia\Core\Event\ActionEvent; use Thelia\Model\Customer; class CustomerLoginEvent extends CustomerEvent diff --git a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php index b1446bfce..6630b7c13 100644 --- a/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Message/MessageUpdateEvent.php @@ -138,4 +138,4 @@ class MessageUpdateEvent extends MessageCreateEvent return $this; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php index ba0fccb68..05b55d733 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductCombinationGenerationEvent.php @@ -65,7 +65,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setReference($reference) { $this->reference = $reference; - return $this; } @@ -77,7 +76,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setPrice($price) { $this->price = $price; - return $this; } @@ -89,7 +87,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setWeight($weight) { $this->weight = $weight; - return $this; } @@ -101,7 +98,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setQuantity($quantity) { $this->quantity = $quantity; - return $this; } @@ -113,7 +109,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setSalePrice($sale_price) { $this->sale_price = $sale_price; - return $this; } @@ -125,7 +120,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setOnsale($onsale) { $this->onsale = $onsale; - return $this; } @@ -137,7 +131,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setIsnew($isnew) { $this->isnew = $isnew; - return $this; } @@ -149,7 +142,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setEanCode($ean_code) { $this->ean_code = $ean_code; - return $this; return $this; } @@ -162,7 +154,6 @@ class ProductCombinationGenerationEvent extends ProductEvent public function setCombinations($combinations) { $this->combinations = $combinations; - return $this; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php index 0e95abfba..af28ca73f 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductSetTemplateEvent.php @@ -60,4 +60,4 @@ class ProductSetTemplateEvent extends ProductEvent return $this; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php index 8f94b254b..811b02fca 100644 --- a/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/ProductSaleElement/ProductSaleElementDeleteEvent.php @@ -22,6 +22,7 @@ /*************************************************************************************/ namespace Thelia\Core\Event\ProductSaleElement; +use Thelia\Model\Product; class ProductSaleElementDeleteEvent extends ProductSaleElementEvent { diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 69c05cf6d..b761cf775 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -370,7 +370,6 @@ final class TheliaEvents */ const ORDER_SET_DELIVERY_ADDRESS = "action.order.setDeliveryAddress"; 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_PAYMENT_MODULE = "action.order.setPaymentModule"; const ORDER_PAY = "action.order.pay"; diff --git a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php index cb287b869..caf46c1aa 100644 --- a/core/lib/Thelia/Core/Event/UpdateSeoEvent.php +++ b/core/lib/Thelia/Core/Event/UpdateSeoEvent.php @@ -184,4 +184,5 @@ class UpdateSeoEvent extends ActionEvent return $this->object; } + } diff --git a/core/lib/Thelia/Core/EventListener/ViewListener.php b/core/lib/Thelia/Core/EventListener/ViewListener.php index 1975eba45..e3eaa9577 100755 --- a/core/lib/Thelia/Core/EventListener/ViewListener.php +++ b/core/lib/Thelia/Core/EventListener/ViewListener.php @@ -30,10 +30,12 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Response; use Symfony\Component\Routing\Router; +use Thelia\Core\HttpKernel\Exception\NotFountHttpException; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserInterface; use Thelia\Core\Template\TemplateHelper; use Thelia\Exception\OrderException; +use Thelia\Model\ConfigQuery; use Thelia\Tools\Redirect; use Thelia\Tools\URL; use Thelia\Core\Security\Exception\AuthenticationException; diff --git a/core/lib/Thelia/Core/HttpFoundation/Response.php b/core/lib/Thelia/Core/HttpFoundation/Response.php index e279215b8..277c16cc2 100644 --- a/core/lib/Thelia/Core/HttpFoundation/Response.php +++ b/core/lib/Thelia/Core/HttpFoundation/Response.php @@ -39,8 +39,8 @@ class Response extends BaseResponse * * @see \Thelia\Core\HttpFoundation\Response::sendContent() */ - public function sendContent() - { + public function sendContent() { + Tlog::getInstance()->write($this->content); parent::sendContent(); diff --git a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php index aceb6235f..b45f0f812 100644 --- a/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php +++ b/core/lib/Thelia/Core/HttpKernel/HttpCache/HttpCache.php @@ -65,8 +65,7 @@ class HttpCache extends BaseHttpCache implements HttpKernelInterface $request->getContent() ); } - return parent::handle($request, $type, $catch); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Security/SecurityContext.php b/core/lib/Thelia/Core/Security/SecurityContext.php index 8512fac0e..e97a19877 100755 --- a/core/lib/Thelia/Core/Security/SecurityContext.php +++ b/core/lib/Thelia/Core/Security/SecurityContext.php @@ -177,7 +177,7 @@ class SecurityContext continue; } - if (!array_key_exists('module', $userPermissions)) { + if(!array_key_exists('module', $userPermissions)) { return false; } diff --git a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php index 6b947b3fb..205ce59ee 100644 --- a/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php +++ b/core/lib/Thelia/Core/Template/Assets/AssetManagerInterface.php @@ -23,12 +23,10 @@ namespace Thelia\Core\Template\Assets; -interface AssetManagerInterface -{ +interface AssetManagerInterface { /** * Prepare an asset directory. * -<<<<<<< HEAD * @param $sourceAssetsDirectory * @param $webAssetsDirectoryBase * @param $webAssetsTemplate @@ -38,18 +36,12 @@ interface AssetManagerInterface * @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 -======= - * @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. ->>>>>>> cleanmaster */ public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey); /** * Generates assets from $asset_path in $output_path, using $filters. * -<<<<<<< HEAD * @param $assetSource * @param $assetDirectoryBase * @param $webAssetsDirectoryBase @@ -65,25 +57,9 @@ interface AssetManagerInterface * * @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 -======= - * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) - * - * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space - * @param string $output_url the URL to the base assets output directory in the web space - * - * @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 boolean $debug the debug mode, true or false ->>>>>>> cleanmaster * * @internal 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. * @return string The URL to the generated asset file. */ -<<<<<<< HEAD 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); -} ->>>>>>> cleanmaster +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php index 93130d5dd..ae210eee8 100755 --- a/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticAssetManager.php @@ -51,7 +51,7 @@ class AsseticAssetManager implements AssetManagerInterface /** * Create a stamp form the modification time of the content of the given directory and all of its subdirectories * - * @param string $directory ther directory name + * @param string $directory ther directory name * @return string the stamp of this directory */ protected function getStamp($directory) @@ -76,8 +76,7 @@ class AsseticAssetManager implements AssetManagerInterface * * @return bool */ - protected function isSourceFile(\SplFileInfo $fileInfo) - { + protected function isSourceFile(\SplFileInfo $fileInfo) { return in_array($fileInfo->getExtension(), $this->source_file_extensions); } @@ -85,14 +84,9 @@ class AsseticAssetManager implements AssetManagerInterface * Recursively copy assets from the source directory to the destination * directory in the web space, omitting source files. * -<<<<<<< HEAD * @param Filesystem $fs * @param string $from_directory the source * @param string $to_directory the destination -======= - * @param string $from_directory the source - * @param string $to_directory the destination ->>>>>>> cleanmaster * @throws \RuntimeException if a problem occurs. */ protected function copyAssets(Filesystem $fs, $from_directory, $to_directory) @@ -130,7 +124,6 @@ class AsseticAssetManager implements AssetManagerInterface } /** -<<<<<<< HEAD * Compute the destination directory path, from the source directory and the * base directory of the web assets * @@ -140,34 +133,6 @@ class AsseticAssetManager implements AssetManagerInterface * * @internal param string $source_assets_directory the source directory * @return the full path of the destination directory -======= - * 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 - * base directory of the web assets - * - * @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 ->>>>>>> cleanmaster */ protected function getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey) { @@ -180,7 +145,6 @@ class AsseticAssetManager implements AssetManagerInterface * the source directory. If any change is detected, the whole asset directory * is copied in the web space. * -<<<<<<< HEAD * @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 @@ -190,14 +154,6 @@ class AsseticAssetManager implements AssetManagerInterface */ public function prepareAssets($sourceAssetsDirectory, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey) { -======= - * @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. - */ - public function prepareAssets($source_assets_directory, $web_assets_directory_base) - { ->>>>>>> cleanmaster // Compute the absolute path of the output directory $to_directory = $this->getDestinationDirectory($webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey); @@ -249,7 +205,8 @@ class AsseticAssetManager implements AssetManagerInterface 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."); } -/* } else { +/* } + else { @fclose($fp); } */ @@ -259,13 +216,13 @@ class AsseticAssetManager implements AssetManagerInterface /** * Decode the filters names, and initialize the Assetic FilterManager * - * @param FilterManager $filterManager the Assetic filter manager - * @param string $filters a comma separated list of filter names + * @param FilterManager $filterManager the Assetic filter manager + * @param string $filters a comma separated list of filter names * @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)) { $filter_list = explode(',', $filters); @@ -304,7 +261,8 @@ class AsseticAssetManager implements AssetManagerInterface break; } } - } else { + } + else { $filter_list = array(); } @@ -314,7 +272,6 @@ class AsseticAssetManager implements AssetManagerInterface /** * Generates assets from $asset_path in $output_path, using $filters. * -<<<<<<< HEAD * @param $assetSource * @param $assetDirectoryBase * @param string $webAssetsDirectoryBase the full path to the asset file (or file collection, e.g. *.less) @@ -328,18 +285,6 @@ class AsseticAssetManager implements AssetManagerInterface * * @param boolean $debug true / false * -======= - * @param string $asset_path the full path to the asset file (or file collection, e.g. *.less) - * - * @param string $web_assets_directory_base the full disk path to the base assets output directory in the web space - * @param string $output_url the URL to the base assets output directory in the web space - * - * @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 boolean $debug true / false - * @throws \InvalidArgumentException if an invalid filter name is found ->>>>>>> cleanmaster * @return string The URL to the generated asset file. */ public function processAsset($assetSource, $assetDirectoryBase, $webAssetsDirectoryBase, $webAssetsTemplate, $webAssetsKey, $outputUrl, $assetType, $filters, $debug) @@ -396,4 +341,4 @@ class AsseticAssetManager implements AssetManagerInterface return rtrim($outputUrl, '/') . '/' . trim($outputRelativeWebPath, '/') . '/' . trim($assetFileDirectoryInAssetDirectory, '/') . '/' . ltrim($assetTargetFilename, '/'); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index db61c20c1..6d4e6ed92 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -277,6 +277,7 @@ abstract class BaseLoop } } + protected function searchArray(array $search, &$pagination = null) { if (false === $this->countable) { @@ -285,7 +286,7 @@ abstract class BaseLoop if ($this->getArgValue('page') !== null) { $nbPage = ceil(count($search)/$this->getArgValue('limit')); - if ($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { + if($this->getArgValue('page') > $nbPage || $this->getArgValue('page') <= 0) { return array(); } @@ -337,9 +338,9 @@ abstract class BaseLoop */ public function exec(&$pagination) { - if ($this instanceof PropelSearchLoopInterface) { + if($this instanceof PropelSearchLoopInterface) { $searchModelCriteria = $this->buildModelCriteria(); - if (null === $searchModelCriteria) { + if(null === $searchModelCriteria) { $results = array(); } else { $results = $this->search( @@ -349,7 +350,7 @@ abstract class BaseLoop } } elseif ($this instanceof ArraySearchLoopInterface) { $searchArray = $this->buildArray(); - if (null === $searchArray) { + if(null === $searchArray) { $results = array(); } else { $results = $this->searchArray( @@ -361,13 +362,13 @@ abstract class BaseLoop $loopResult = new LoopResult($results); - if (true === $this->countable) { + if(true === $this->countable) { $loopResult->setCountable(); } - if (true === $this->timestampable) { + if(true === $this->timestampable) { $loopResult->setTimestamped(); } - if (true === $this->versionable) { + if(true === $this->versionable) { $loopResult->setVersioned(); } @@ -381,29 +382,29 @@ abstract class BaseLoop * - ArraySearchLoopInterface */ $searchInterface = false; - if ($this instanceof PropelSearchLoopInterface) { - if (true === $searchInterface) { + if($this instanceof PropelSearchLoopInterface) { + if(true === $searchInterface) { throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } - if ($this instanceof ArraySearchLoopInterface) { - if (true === $searchInterface) { + if($this instanceof ArraySearchLoopInterface) { + if(true === $searchInterface) { throw new LoopException('Loop cannot implements multiple Search Interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::MULTIPLE_SEARCH_INTERFACE); } $searchInterface = true; } - if (false === $searchInterface) { + if(false === $searchInterface) { throw new LoopException('Loop must implements one of the following interfaces : `PropelSearchLoopInterface`, `ArraySearchLoopInterface`', LoopException::SEARCH_INTERFACE_NOT_FOUND); } /* Only PropelSearch allows timestamp and version */ - if (!$this instanceof PropelSearchLoopInterface) { - if (true === $this->timestampable) { + if(!$this instanceof PropelSearchLoopInterface) { + if(true === $this->timestampable) { throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be timestampable", LoopException::NOT_TIMESTAMPED); } - if (true === $this->versionable) { + if(true === $this->versionable) { throw new LoopException("Loop must implements 'PropelSearchLoopInterface' to be versionable", LoopException::NOT_VERSIONED); } } diff --git a/core/lib/Thelia/Core/Template/Loop/Admin.php b/core/lib/Thelia/Core/Template/Loop/Admin.php index d9c49ef80..ef5ce7e1f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Admin.php +++ b/core/lib/Thelia/Core/Template/Loop/Admin.php @@ -33,6 +33,7 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\AdminQuery; +use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php index 4ae41c3b6..9411b1dbd 100755 --- a/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php +++ b/core/lib/Thelia/Core/Template/Loop/AssociatedContent.php @@ -48,7 +48,7 @@ class AssociatedContent extends Content { protected $contentId; protected $contentPosition; - + /** * @return ArgumentCollection */ diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php index 0cb7a5e88..072193f34 100755 --- a/core/lib/Thelia/Core/Template/Loop/Auth.php +++ b/core/lib/Thelia/Core/Template/Loop/Auth.php @@ -88,7 +88,7 @@ class Auth extends BaseLoop implements ArraySearchLoopInterface $module = $this->getModule(); $access = $this->getAccess(); - if (null !== $module) { + if(null !== $module) { $in = true; } diff --git a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php index ae7226152..c1bc483f9 100644 --- a/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php +++ b/core/lib/Thelia/Core/Template/Loop/BaseSpecificModule.php @@ -24,6 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Core\Template\Element\BaseI18nLoop; +use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; diff --git a/core/lib/Thelia/Core/Template/Loop/Cart.php b/core/lib/Thelia/Core/Template/Loop/Cart.php index 32c6d9ff2..88b5a53d4 100755 --- a/core/lib/Thelia/Core/Template/Loop/Cart.php +++ b/core/lib/Thelia/Core/Template/Loop/Cart.php @@ -58,7 +58,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface { $cart = $this->getCart($this->request); - if (null === $cart) { + if(null === $cart) { return array(); } @@ -81,7 +81,7 @@ class Cart extends BaseLoop implements ArraySearchLoopInterface { $taxCountry = TaxEngine::getInstance($this->request->getSession())->getDeliveryCountry(); - foreach ($loopResult->getResultDataCollection() as $cartItem) { + foreach($loopResult->getResultDataCollection() as $cartItem) { $product = $cartItem->getProduct(); $productSaleElement = $cartItem->getProductSaleElements(); diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php index d70654d0b..1b7f68f22 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php @@ -125,9 +125,9 @@ class CategoryPath extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach ($loopResult->getResultDataCollection() as $result) { + foreach($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach ($result as $output => $outputValue) { + foreach($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php index 35a9569f9..3c3c3ffe0 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php @@ -99,9 +99,9 @@ class CategoryTree extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach ($loopResult->getResultDataCollection() as $result) { + foreach($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach ($result as $output => $outputValue) { + foreach($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index 622a3a18c..e211103da 100755 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -24,6 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; +use Propel\Runtime\Util\PropelModelPager; use Thelia\Condition\ConditionFactory; use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Core\HttpFoundation\Request; diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index 3d7a5631e..82aebeb32 100755 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -158,7 +158,6 @@ class Currency extends BaseI18nLoop implements PropelSearchLoopInterface } /* perform search */ - return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Customer.php b/core/lib/Thelia/Core/Template/Loop/Customer.php index d4b8effb0..f955cd217 100755 --- a/core/lib/Thelia/Core/Template/Loop/Customer.php +++ b/core/lib/Thelia/Core/Template/Loop/Customer.php @@ -36,6 +36,9 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\CustomerQuery; use Thelia\Type\TypeCollection; use Thelia\Type; +use Thelia\Model\OrderQuery; +use Thelia\Model\Map\OrderAddressTableMap; +use Thelia\Model\Map\OrderTableMap; /** * @@ -205,6 +208,7 @@ class Customer extends BaseLoop implements SearchLoopInterface, PropelSearchLoop $search->orderByCreatedAt(Criteria::DESC); break; + } } diff --git a/core/lib/Thelia/Core/Template/Loop/Delivery.php b/core/lib/Thelia/Core/Template/Loop/Delivery.php index 93c73bb17..f671f1ca9 100644 --- a/core/lib/Thelia/Core/Template/Loop/Delivery.php +++ b/core/lib/Thelia/Core/Template/Loop/Delivery.php @@ -74,8 +74,8 @@ class Delivery extends BaseSpecificModule try { $postage = $moduleInstance->getPostage($country); - } catch (OrderException $e) { - switch ($e->getCode()) { + } catch(OrderException $e) { + switch($e->getCode()) { case OrderException::DELIVERY_MODULE_UNAVAILABLE: /* do not show this delivery module */ continue(2); diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index fa561b3fb..84dee9f82 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -126,6 +126,7 @@ class Folder extends BaseI18nLoop implements PropelSearchLoopInterface if ($visible !== BooleanOrBothType::ANY) $search->filterByVisible($visible ? 1 : 0); + $orders = $this->getOrder(); foreach ($orders as $order) { diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php index b50d7c55d..92c42f890 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php @@ -135,9 +135,9 @@ class FolderPath extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach ($loopResult->getResultDataCollection() as $result) { + foreach($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach ($result as $output => $outputValue) { + foreach($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/FolderTree.php b/core/lib/Thelia/Core/Template/Loop/FolderTree.php index 851b6d8ff..9598f7a5c 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderTree.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderTree.php @@ -100,9 +100,9 @@ class FolderTree extends BaseI18nLoop implements ArraySearchLoopInterface public function parseResults(LoopResult $loopResult) { - foreach ($loopResult->getResultDataCollection() as $result) { + foreach($loopResult->getResultDataCollection() as $result) { $loopResultRow = new LoopResultRow($result); - foreach ($result as $output => $outputValue) { + foreach($result as $output => $outputValue) { $loopResultRow->set($output, $outputValue); } $loopResult->addRow($loopResultRow); diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php index def24ae2a..b207deb29 100755 --- a/core/lib/Thelia/Core/Template/Loop/Image.php +++ b/core/lib/Thelia/Core/Template/Loop/Image.php @@ -236,6 +236,7 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface $search->filterById($exclude, Criteria::NOT_IN); // echo "sql=".$search->toString(); + return $search; } diff --git a/core/lib/Thelia/Core/Template/Loop/Module.php b/core/lib/Thelia/Core/Template/Loop/Module.php index c3f544382..db947f730 100755 --- a/core/lib/Thelia/Core/Template/Loop/Module.php +++ b/core/lib/Thelia/Core/Template/Loop/Module.php @@ -196,19 +196,19 @@ class Module extends BaseI18nLoop implements PropelSearchLoopInterface /* first test if module defines it's own config route */ $routerId = "router." . $module->getBaseDir(); - if ($this->container->has($routerId)) { + if($this->container->has($routerId)) { try { - if ($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { + if($this->container->get($routerId)->match('/admin/module/' . $module->getCode())) { $hasConfigurationInterface = true; } - } catch (ResourceNotFoundException $e) { + } catch(ResourceNotFoundException $e) { /* $hasConfigurationInterface stays false */ } } /* if not ; test if it uses admin inclusion : module_configuration.html */ - if (false === $hasConfigurationInterface) { - if (file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) { + if(false === $hasConfigurationInterface) { + if(file_exists( sprintf("%s/AdminIncludes/%s.html", $module->getAbsoluteBaseDir(), "module_configuration"))) { $hasConfigurationInterface = true; } } diff --git a/core/lib/Thelia/Core/Template/Loop/Order.php b/core/lib/Thelia/Core/Template/Loop/Order.php index 3fb04d60c..5f12fa1eb 100755 --- a/core/lib/Thelia/Core/Template/Loop/Order.php +++ b/core/lib/Thelia/Core/Template/Loop/Order.php @@ -46,7 +46,7 @@ use Thelia\Type; */ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInterface { - protected $countable = true; + protected $countable = true; protected $timestampable = true; protected $versionable = false; @@ -175,6 +175,7 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt } return $search; + } public function parseResults(LoopResult $loopResult) @@ -201,7 +202,6 @@ class Order extends BaseLoop implements SearchLoopInterface, PropelSearchLoopInt ->set("STATUS", $order->getStatusId()) ->set("LANG", $order->getLangId()) ->set("POSTAGE", $order->getPostage()) - ->set("DISCOUNT", $order->getDiscount()) ->set("TOTAL_TAX", $tax) ->set("TOTAL_AMOUNT", $amount - $tax) ->set("TOTAL_TAXED_AMOUNT", $amount) diff --git a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php b/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php deleted file mode 100755 index 80e24c487..000000000 --- a/core/lib/Thelia/Core/Template/Loop/OrderCoupon.php +++ /dev/null @@ -1,116 +0,0 @@ -. */ -/* */ -/**********************************************************************************/ - -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 - */ -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; - } -} diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php index 8e201f31c..f36162099 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProduct.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProduct.php @@ -72,7 +72,7 @@ class OrderProduct extends BaseLoop implements PropelSearchLoopInterface $search->orderById(Criteria::ASC); return $search; - + } public function parseResults(LoopResult $loopResult) diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php index bb018ec98..f248159c5 100755 --- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php @@ -87,7 +87,7 @@ class OrderProductAttributeCombination extends BaseI18nLoop implements PropelSea } return $search; - + } public function parseResults(LoopResult $loopResult) diff --git a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php index 4d6491509..ea1d94262 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductTemplate.php @@ -103,4 +103,4 @@ class ProductTemplate extends BaseI18nLoop implements PropelSearchLoopInterface return $loopResult; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Loop/Profile.php b/core/lib/Thelia/Core/Template/Loop/Profile.php index 8b21d2fe0..bddcf856c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Profile.php +++ b/core/lib/Thelia/Core/Template/Loop/Profile.php @@ -33,6 +33,7 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\ProfileQuery; +use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index f3b4a05f9..7050aa34a 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -23,12 +23,19 @@ 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\LoopResultRow; +use Thelia\Core\Template\Element\PropelSearchLoopInterface; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; +use Thelia\Model\ModuleQuery; + +use Thelia\Module\BaseModule; use Thelia\Type; use Thelia\Core\Template\TemplateHelper; use Thelia\Core\Template\TemplateDefinition; @@ -65,14 +72,8 @@ class Template extends BaseLoop implements ArraySearchLoopInterface ); } -<<<<<<< HEAD public function buildArray() { $type = $this->getArg('template-type')->getValue(); -======= - public function buildArray() - { - $type = $this->getArg(template_type); ->>>>>>> cleanmaster if ($type == 'front-office') $templateType = TemplateDefinition::FRONT_OFFICE; @@ -103,4 +104,4 @@ class Template extends BaseLoop implements ArraySearchLoopInterface return $loopResult; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index 5deb6e9d0..6e78f0d7f 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -23,11 +23,8 @@ namespace Thelia\Core\Template\Smarty\Assets; -<<<<<<< HEAD use Thelia\Core\Template\Assets\AsseticHelper; use Thelia\Core\Template\TemplateDefinition; -======= ->>>>>>> cleanmaster use Thelia\Tools\URL; use Thelia\Core\Template\Assets\AssetManagerInterface; @@ -45,9 +42,9 @@ class SmartyAssetsManager /** * Creates a new SmartyAssetsManager instance * - * @param AssetManagerInterface $assetsManager an asset manager instance - * @param string $web_root the disk path to the web root (with final /) - * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated + * @param AssetManagerInterface $assetsManager an asset manager instance + * @param string $web_root the disk path to the web root (with final /) + * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated */ public function __construct(AssetManagerInterface $assetsManager, $web_root, $path_relative_to_web_root) { @@ -59,7 +56,6 @@ class SmartyAssetsManager public function prepareAssets($assets_directory, \Smarty_Internal_Template $template) { -<<<<<<< HEAD self::$assetsDirectory = $assets_directory; $smartyParser = $template->smarty; @@ -74,9 +70,6 @@ class SmartyAssetsManager foreach($templateDirectories[$templateDefinition->getName()] as $key => $directory) { $tpl_path = $directory . DS . self::$assetsDirectory; -======= - $tpl_dir = dirname($template->source->filepath); ->>>>>>> cleanmaster $asset_dir_absolute_path = realpath($tpl_path); @@ -144,4 +137,4 @@ class SmartyAssetsManager return $content; } } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php index 8b8ee8ef1..78e1c8f5b 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/AdminUtilities.php @@ -27,6 +27,8 @@ use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Tools\URL; use Thelia\Core\Security\SecurityContext; +use Thelia\Model\Config; +use Thelia\Model\ConfigQuery; use Thelia\Core\Template\TemplateHelper; /** @@ -43,8 +45,8 @@ class AdminUtilities extends AbstractSmartyPlugin $this->securityContext = $securityContext; } - protected function fetch_snippet($smarty, $templateName, $variablesArray) - { + protected function fetch_snippet($smarty, $templateName, $variablesArray) { + $data = ''; $snippet_path = sprintf('%s/%s/%s.html', @@ -97,6 +99,7 @@ class AdminUtilities extends AbstractSmartyPlugin $module === null ? array() : array($module), array($access)) ) { + 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_in_place_edit_class' => $in_place_edit_class, diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php index e4a5c866f..e4c220ed5 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assets.php @@ -56,11 +56,10 @@ class Assets extends AbstractSmartyPlugin { try { return $this->assetManager->processSmartyPluginCall('js', $params, $content, $template, $repeat); - } catch (\Exception $e) { + } catch(\Exception $e) { $catchException = $this->getNormalizedParam($params, array('catchException')); - if ($catchException == "true") { + if($catchException == "true") { $repeat = false; - return null; } else { throw $e; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index 236f6b8be..eab83e140 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -212,8 +212,6 @@ class DataAccessFunctions extends AbstractSmartyPlugin switch ($attribute) { case 'postage': return $order->getPostage(); - case 'discount': - return $order->getDiscount(); case 'delivery_address': return $order->chosenDeliveryAddress; case 'invoice_address': @@ -269,69 +267,69 @@ class DataAccessFunctions extends AbstractSmartyPlugin $includeShipping = true; } - if ($params['startDate'] == 'today') { + if($params['startDate'] == 'today') { $startDate = new \DateTime(); $startDate->setTime(0, 0, 0); - } elseif ($params['startDate'] == 'yesterday') { + } elseif($params['startDate'] == 'yesterday') { $startDate = new \DateTime(); $startDate->setTime(0, 0, 0); $startDate->modify('-1 day'); - } elseif ($params['startDate'] == 'this_month') { + } elseif($params['startDate'] == 'this_month') { $startDate = new \DateTime(); $startDate->modify('first day of this month'); $startDate->setTime(0, 0, 0); - } elseif ($params['startDate'] == 'last_month') { + } elseif($params['startDate'] == 'last_month') { $startDate = new \DateTime(); $startDate->modify('first day of last month'); $startDate->setTime(0, 0, 0); - } elseif ($params['startDate'] == 'this_year') { + } elseif($params['startDate'] == 'this_year') { $startDate = new \DateTime(); $startDate->modify('first day of January this year'); $startDate->setTime(0, 0, 0); - } elseif ($params['startDate'] == 'last_year') { + } elseif($params['startDate'] == 'last_year') { $startDate = new \DateTime(); $startDate->modify('first day of December last year'); $startDate->setTime(0, 0, 0); } else { try { $startDate = new \DateTime($params['startDate']); - } catch (\Exception $e) { + } catch(\Exception $e) { throw new \InvalidArgumentException(sprintf("invalid startDate attribute '%s' in stats access function", $params['startDate'])); } } - if ($params['endDate'] == 'today') { + if($params['endDate'] == 'today') { $endDate = new \DateTime(); $endDate->setTime(0, 0, 0); - } elseif ($params['endDate'] == 'yesterday') { + } elseif($params['endDate'] == 'yesterday') { $endDate = new \DateTime(); $endDate->setTime(0, 0, 0); $endDate->modify('-1 day'); - } elseif ($params['endDate'] == 'this_month') { + } elseif($params['endDate'] == 'this_month') { $endDate = new \DateTime(); $endDate->modify('last day of this month'); $endDate->setTime(0, 0, 0); - } elseif ($params['endDate'] == 'last_month') { + } elseif($params['endDate'] == 'last_month') { $endDate = new \DateTime(); $endDate->modify('last day of last month'); $endDate->setTime(0, 0, 0); - } elseif ($params['endDate'] == 'this_year') { + } elseif($params['endDate'] == 'this_year') { $endDate = new \DateTime(); $endDate->modify('last day of December this year'); $endDate->setTime(0, 0, 0); - } elseif ($params['endDate'] == 'last_year') { + } elseif($params['endDate'] == 'last_year') { $endDate = new \DateTime(); $endDate->modify('last day of January last year'); $endDate->setTime(0, 0, 0); } else { try { $endDate = new \DateTime($params['endDate']); - } catch (\Exception $e) { + } catch(\Exception $e) { throw new \InvalidArgumentException(sprintf("invalid endDate attribute '%s' in stats access function", $params['endDate'])); } } - switch ($params['key']) { + switch( $params['key'] ) { case 'sales' : return OrderQuery::getSaleStats($startDate, $endDate, $includeShipping); case 'orders' : diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php index cfa3788bd..453335740 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Esi.php @@ -28,6 +28,7 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Smarty\an; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; + /** * Class Esi * @package Thelia\Core\Template\Smarty\Plugins @@ -52,7 +53,7 @@ class Esi extends AbstractSmartyPlugin $ignore_errors = $this->getParam($params, 'ignore_errors'); $comment = $this->getParam($params, 'comment'); - if (null === $path) { + if(null === $path) { return; } @@ -78,4 +79,4 @@ class Esi extends AbstractSmartyPlugin new SmartyPluginDescriptor('function', 'render_esi', $this, 'renderEsi') ); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php index 4c92ee85c..9b86410de 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php @@ -48,7 +48,7 @@ class Module extends AbstractSmartyPlugin /** * Process theliaModule template inclusion function * - * @param unknown $params + * @param unknown $params * @param \Smarty_Internal_Template $template * @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty * @@ -60,7 +60,7 @@ class Module extends AbstractSmartyPlugin if (false !== $location = $this->getParam($params, 'location', false)) { - if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) { + if($this->debug === true && $this->request->get('SHOW_INCLUDE')) { echo sprintf('
%s
', $location); } @@ -70,7 +70,7 @@ class Module extends AbstractSmartyPlugin foreach ($modules as $module) { - if (null !== $moduleLimit && $moduleLimit != $module->getCode()) { + if(null !== $moduleLimit && $moduleLimit != $module->getCode()) { continue; } diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index 9d3ff3fe0..4203d8270 100755 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -14,13 +14,9 @@ use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserContext; use Thelia\Core\Template\TemplateDefinition; -<<<<<<< HEAD use Thelia\Model\ConfigQuery; use Thelia\Core\Template\TemplateHelper; use Imagine\Exception\InvalidArgumentException; -======= -use Thelia\Core\Translation\Translator; ->>>>>>> cleanmaster /** * @@ -75,6 +71,7 @@ class SmartyParser extends Smarty implements ParserInterface $this->setCompileDir($compile_dir); $this->setCacheDir($cache_dir); + $this->debugging = $debug; // Prevent smarty ErrorException: Notice: Undefined index bla bla bla... @@ -82,7 +79,7 @@ class SmartyParser extends Smarty implements ParserInterface // Si on n'est pas en mode debug, activer le cache, avec une lifetime de 15mn, et en vérifiant que les templates sources n'ont pas été modifiés. - if ($debug) { + if($debug) { $this->setCaching(Smarty::CACHING_OFF); $this->setForceCompile(true); } else { @@ -91,6 +88,7 @@ class SmartyParser extends Smarty implements ParserInterface //$this->enableSecurity(); + // The default HTTP status $this->status = 200; @@ -167,7 +165,6 @@ class SmartyParser extends Smarty implements ParserInterface $this->setConfigDir($configDirectory); /* add modules template directories */ -<<<<<<< HEAD $this->addTemplateDirectory( $templateDefinition->getType(), $templateDefinition->getName(), @@ -181,32 +178,6 @@ class SmartyParser extends Smarty implements ParserInterface foreach($this->templateDirectories[$templateDefinition->getType()][$templateDefinition->getName()] as $key => $directory) { $this->addTemplateDir($directory, $key); } -======= - switch ($templateDefinition->getType()) { - case TemplateDefinition::FRONT_OFFICE: - /* do not pass array directly to addTemplateDir since we cant control on keys */ - if (isset($this->frontOfficeTemplateDirectories[$templateDefinition->getName()])) { - foreach ($this->frontOfficeTemplateDirectories[$templateDefinition->getName()] as $key => $directory) { - $this->addTemplateDir($directory, $key); - } - } - break; - - case TemplateDefinition::BACK_OFFICE: - /* do not pass array directly to addTemplateDir since we cant control on keys */ - 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; ->>>>>>> cleanmaster } } @@ -215,20 +186,7 @@ class SmartyParser extends Smarty implements ParserInterface return $this->templateDefinition; } -<<<<<<< HEAD public function getTemplate() -======= - /** - * Return a rendered template, either from file or ftom a string - * - * @param string $resourceType either 'string' (rendering from a string) or 'file' (rendering a file) - * @param string $resourceContent the resource content (a text, or a template file name) - * @param array $parameters an associative array of names / value pairs - * - * @return string the rendered template text - */ - protected function internalRenderer($resourceType, $resourceContent, array $parameters) ->>>>>>> cleanmaster { return $this->templateDefinition->getPath(); } @@ -242,35 +200,17 @@ class SmartyParser extends Smarty implements ParserInterface */ public function render($realTemplateName, array $parameters = array()) { -<<<<<<< HEAD if(false === $this->templateExists($realTemplateName)) { throw new ResourceNotFoundException(); } // Assign the parserContext variables foreach ($this->parserContext as $var => $value) { $this->assign($var, $value); -======= - if (false === $this->templateExists($realTemplateName)) { - throw new ResourceNotFoundException(Translator::getInstance()->trans("Template file %file cannot be found.", array('%file', $realTemplateName))); ->>>>>>> cleanmaster } $this->assign($parameters); -<<<<<<< HEAD return $this->fetch(sprintf("file:%s", $realTemplateName)); -======= - /** - * Return a rendered template text - * - * @param string $templateText the template text - * @param array $parameters an associative array of names / value pairs - * @return string the rendered template text - */ - public function renderString($templateText, array $parameters = array()) - { - return $this->internalRenderer('string', $templateText, $parameters); ->>>>>>> cleanmaster } /** diff --git a/core/lib/Thelia/Core/Template/TemplateDefinition.php b/core/lib/Thelia/Core/Template/TemplateDefinition.php index 54923acfe..7aa549ac0 100644 --- a/core/lib/Thelia/Core/Template/TemplateDefinition.php +++ b/core/lib/Thelia/Core/Template/TemplateDefinition.php @@ -57,12 +57,13 @@ class TemplateDefinition */ protected $type; + public function __construct($name, $type) { $this->name = $name; $this->type = $type; - switch ($type) { + switch($type) { case TemplateDefinition::FRONT_OFFICE: $this->path = self::FRONT_OFFICE_SUBDIR . $name; break; @@ -89,17 +90,14 @@ class TemplateDefinition public function setName($name) { $this->name = $name; - return $this; } - public function getI18nPath() - { + public function getI18nPath() { return $this->getPath() . DS . 'I18n'; } - public function getAbsoluteI18nPath() - { + public function getAbsoluteI18nPath() { return THELIA_TEMPLATE_DIR . $this->getI18nPath(); } @@ -108,8 +106,7 @@ class TemplateDefinition return $this->path; } - public function getAbsolutePath() - { + public function getAbsolutePath() { return THELIA_TEMPLATE_DIR . $this->getPath(); } @@ -118,15 +115,13 @@ class TemplateDefinition return $this->getPath() . DS . 'configs'; } - public function getAbsoluteConfigPath() - { + public function getAbsoluteConfigPath() { return THELIA_TEMPLATE_DIR . $this->getConfigPath(); } public function setPath($path) { $this->path = $path; - return $this; } @@ -138,10 +133,8 @@ class TemplateDefinition public function setType($type) { $this->type = $type; - return $this; } -<<<<<<< HEAD /** * Returns an iterator on the standard templates subdir names @@ -149,7 +142,4 @@ class TemplateDefinition public static function getStandardTemplatesSubdirsIterator() { return new \ArrayIterator(self::$standardTemplatesSubdirs); } -} -======= -} ->>>>>>> cleanmaster +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/TemplateHelper.php b/core/lib/Thelia/Core/Template/TemplateHelper.php index b7c8fcddd..175f83b42 100644 --- a/core/lib/Thelia/Core/Template/TemplateHelper.php +++ b/core/lib/Thelia/Core/Template/TemplateHelper.php @@ -40,17 +40,16 @@ class TemplateHelper private function __construct() {} - public static function getInstance() - { + public static function getInstance() { if (self::$instance == null) self::$instance = new TemplateHelper(); + return self::$instance; } /** * @return TemplateDefinition */ - public function getActiveMailTemplate() - { + public function getActiveMailTemplate() { return new TemplateDefinition( ConfigQuery::read('active-mail-template', 'default'), TemplateDefinition::EMAIL @@ -60,8 +59,7 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActivePdfTemplate() - { + public function getActivePdfTemplate() { return new TemplateDefinition( ConfigQuery::read('active-pdf-template', 'default'), TemplateDefinition::PDF @@ -71,8 +69,7 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActiveAdminTemplate() - { + public function getActiveAdminTemplate() { return new TemplateDefinition( ConfigQuery::read('active-admin-template', 'default'), TemplateDefinition::BACK_OFFICE @@ -82,15 +79,13 @@ class TemplateHelper /** * @return TemplateDefinition */ - public function getActiveFrontTemplate() - { + public function getActiveFrontTemplate() { return new TemplateDefinition( ConfigQuery::read('active-front-template', 'default'), TemplateDefinition::FRONT_OFFICE ); } -<<<<<<< HEAD /** * Returns an array which contains all standard template definitions */ @@ -114,18 +109,6 @@ class TemplateHelper $list = $exclude = array(); $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) { @@ -151,6 +134,7 @@ class TemplateHelper } } + protected function normalize_path($path) { $path = str_replace( @@ -171,27 +155,28 @@ class TemplateHelper * 'translation' => the text translation, or an empty string if none available. * 'dollar' => true if the translatable text contains a $ * - * @param string $directory the path to the directory to examine - * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE - * @param \Thelia\Core\Translation\Translator $translator the current translator - * @param string $currentLocale the current locale - * @param array $strings the list of strings - * @throws \InvalidArgumentException if $walkMode contains an invalid value - * @return number the total number of translatable texts + * @param string $directory the path to the directory to examine + * @param string $walkMode type of file scanning: WALK_MODE_PHP or WALK_MODE_TEMPLATE + * @param \Thelia\Core\Translation\Translator $translator the current translator + * @param string $currentLocale the current locale + * @param array $strings the list of strings + * @throws \InvalidArgumentException if $walkMode contains an invalid value + * @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; if ($walkMode == self::WALK_MODE_PHP) { $prefix = '\-\>[\s]*trans[\s]*\('; $allowed_exts = array('php'); - } elseif ($walkMode == self::WALK_MODE_TEMPLATE) { + } else if ($walkMode == self::WALK_MODE_TEMPLATE) { $prefix = '\{intl[\s]l='; $allowed_exts = array('html', 'tpl', 'xml'); - } else { + } + else { throw new \InvalidArgumentException( Translator::getInstance()->trans('Invalid value for walkMode parameter: %value', array('%value' => $walkMode)) ); @@ -225,15 +210,18 @@ class TemplateHelper Tlog::getInstance()->debug("Strings found: ", $matches[2]); - foreach ($matches[2] as $match) { + foreach($matches[2] as $match) { $hash = md5($match); - if (isset($strings[$hash])) { - if (! in_array($short_path, $strings[$hash]['files'])) { + if (isset($strings[$hash])) + { + if (! in_array($short_path, $strings[$hash]['files'])) + { $strings[$hash]['files'][] = $short_path; } - } else { + } + else { $num_texts++; // remove \' @@ -285,7 +273,9 @@ class TemplateHelper fwrite($fp, ");\n"); @fclose($fp); - } else { + } + else + { throw new \RuntimeException( Translator::getInstance()->trans( 'Failed to open translation file %file. Please be sure that this file is writable by your Web server', diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index acc6ba1f6..3fb205433 100755 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -49,6 +49,7 @@ use Thelia\Config\DefinePropel; use Thelia\Core\Template\TemplateDefinition; use Thelia\Core\TheliaContainerBuilder; use Thelia\Core\DependencyInjection\Loader\XmlFileLoader; +use Thelia\Model\ConfigQuery; use Symfony\Component\Config\FileLocator; use Propel\Runtime\Propel; @@ -175,7 +176,7 @@ class Thelia extends Kernel ->depth(0) ->in(THELIA_ROOT . "/core/lib/Thelia/Config/Resources"); - foreach ($finder as $file) { + foreach($finder as $file) { $loader->load($file->getBaseName()); } @@ -197,11 +198,6 @@ class Thelia extends Kernel $definition ); -<<<<<<< HEAD -======= - $code = ucfirst($module->getCode()); - ->>>>>>> cleanmaster $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath())); $loader->load("config.xml"); diff --git a/core/lib/Thelia/Core/TheliaHttpKernel.php b/core/lib/Thelia/Core/TheliaHttpKernel.php index 6449d0648..ed4dd672b 100755 --- a/core/lib/Thelia/Core/TheliaHttpKernel.php +++ b/core/lib/Thelia/Core/TheliaHttpKernel.php @@ -215,7 +215,7 @@ class TheliaHttpKernel extends HttpKernel protected function initSession(Request $request) { - if (null === self::$session) { + if(null === self::$session) { $storage = new Session\Storage\NativeSessionStorage(); if (Model\ConfigQuery::read("session_config.default")) { diff --git a/core/lib/Thelia/Core/Translation/Translator.php b/core/lib/Thelia/Core/Translation/Translator.php index fc1c75de2..775ef7ad8 100755 --- a/core/lib/Thelia/Core/Translation/Translator.php +++ b/core/lib/Thelia/Core/Translation/Translator.php @@ -40,7 +40,7 @@ class Translator extends BaseTranslator public function getLocale() { - if ($this->container->isScopeActive('request') && $this->container->has('request')) { + if($this->container->isScopeActive('request') && $this->container->has('request')) { return $this->container->get('request')->getSession()->getLang()->getLocale(); } diff --git a/core/lib/Thelia/Coupon/CouponManager.php b/core/lib/Thelia/Coupon/CouponManager.php index 17d85b8cb..c4eff7888 100644 --- a/core/lib/Thelia/Coupon/CouponManager.php +++ b/core/lib/Thelia/Coupon/CouponManager.php @@ -82,8 +82,15 @@ class CouponManager if (count($this->coupons) > 0) { $couponsKept = $this->sortCoupons($this->coupons); + $isRemovingPostage = $this->isCouponRemovingPostage($couponsKept); + $discount = $this->getEffect($couponsKept); + if ($isRemovingPostage) { + $postage = $this->facade->getCheckoutPostagePrice(); + $discount += $postage; + } + // Just In Case test $checkoutTotalPrice = $this->facade->getCartTotalPrice(); if ($discount >= $checkoutTotalPrice) { @@ -96,24 +103,23 @@ class CouponManager /** * Check if there is a Coupon removing Postage + * + * @param array $couponsKept Array of CouponInterface sorted + * * @return bool */ - public function isCouponRemovingPostage() + protected function isCouponRemovingPostage(array $couponsKept) { - if (count($this->coupons) == 0) { - return false; - } - - $couponsKept = $this->sortCoupons($this->coupons); + $isRemovingPostage = false; /** @var CouponInterface $coupon */ foreach ($couponsKept as $coupon) { if ($coupon->isRemovingPostage()) { - return true; + $isRemovingPostage = true; } } - return false; + return $isRemovingPostage; } /** diff --git a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php index 6f44ecc92..3bf0c372a 100755 --- a/core/lib/Thelia/Form/CustomerProfileUpdateForm.php +++ b/core/lib/Thelia/Form/CustomerProfileUpdateForm.php @@ -23,6 +23,7 @@ namespace Thelia\Form; use Symfony\Component\Validator\ExecutionContextInterface; +use Thelia\Core\Translation\Translator; use Thelia\Model\CustomerQuery; /** diff --git a/core/lib/Thelia/Form/MailingSystemModificationForm.php b/core/lib/Thelia/Form/MailingSystemModificationForm.php index 709c19144..8334777ab 100644 --- a/core/lib/Thelia/Form/MailingSystemModificationForm.php +++ b/core/lib/Thelia/Form/MailingSystemModificationForm.php @@ -23,6 +23,7 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Core\Translation\Translator; use Thelia\Model\ProfileQuery; diff --git a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php index 1ca633ccd..8e4b155b9 100644 --- a/core/lib/Thelia/Form/ProductCombinationGenerationForm.php +++ b/core/lib/Thelia/Form/ProductCombinationGenerationForm.php @@ -23,6 +23,7 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; +use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Model\Currency; use Thelia\Core\Translation\Translator; @@ -87,4 +88,4 @@ class ProductCombinationGenerationForm extends BaseForm { return 'thelia_product_combination_generation_form'; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Form/ProductModificationForm.php b/core/lib/Thelia/Form/ProductModificationForm.php index d2819737c..9dce2e4e5 100644 --- a/core/lib/Thelia/Form/ProductModificationForm.php +++ b/core/lib/Thelia/Form/ProductModificationForm.php @@ -25,6 +25,7 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; use Thelia\Core\Translation\Translator; + class ProductModificationForm extends ProductCreationForm { use StandardDescriptionFieldsTrait; diff --git a/core/lib/Thelia/Form/SeoFieldsTrait.php b/core/lib/Thelia/Form/SeoFieldsTrait.php index 95ce487fc..5b3270793 100644 --- a/core/lib/Thelia/Form/SeoFieldsTrait.php +++ b/core/lib/Thelia/Form/SeoFieldsTrait.php @@ -35,7 +35,7 @@ trait SeoFieldsTrait /** * Add seo meta title, meta description and meta keywords fields * - * @param array $exclude name of the fields that should not be added to the form + * @param array $exclude name of the fields that should not be added to the form */ protected function addSeoFields($exclude = array()) { diff --git a/core/lib/Thelia/Form/SystemLogConfigurationForm.php b/core/lib/Thelia/Form/SystemLogConfigurationForm.php index f4eb62285..9ba9e6cf2 100644 --- a/core/lib/Thelia/Form/SystemLogConfigurationForm.php +++ b/core/lib/Thelia/Form/SystemLogConfigurationForm.php @@ -23,6 +23,8 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; +use Thelia\Model\ConfigQuery; +use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Log\Tlog; use Thelia\Core\Translation\Translator; diff --git a/core/lib/Thelia/Install/CheckPermission.php b/core/lib/Thelia/Install/CheckPermission.php index efdaf6f04..6a9a5245e 100644 --- a/core/lib/Thelia/Install/CheckPermission.php +++ b/core/lib/Thelia/Install/CheckPermission.php @@ -58,7 +58,7 @@ class CheckPermission extends BaseInstall /** @var array Minimum server configuration necessary */ protected $minServerConfigurationNecessary = array( - 'memory_limit' => 134217728, + 'memory_limit' => 157286400, 'post_max_size' => 20971520, 'upload_max_filesize' => 2097152 ); diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php index 08b7aab66..80aa3ec25 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php @@ -138,4 +138,4 @@ class TlogDestinationFile extends AbstractTlogDestination $this->fh = false; } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php index e1f3444a5..546ab488c 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationJavascriptConsole.php @@ -25,29 +25,27 @@ namespace Thelia\Log\Destination; use Thelia\Log\AbstractTlogDestination; -class TlogDestinationJavascriptConsole extends AbstractTlogDestination -{ - public function getTitle() - { - return "Browser's Javascript console"; - } +class TlogDestinationJavascriptConsole extends AbstractTlogDestination { - public function getDescription() - { - return "The Thelia logs are displayed in your browser's Javascript console."; - } + public function getTitle() { + return "Browser's Javascript console"; + } - public function write(&$res) - { - $content = ''."\n"; + $content = ''."\n"; + + if (preg_match("||i", $res)) + $res = preg_replace("||i", "$content", $res); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php index 547a24c85..1734e2f43 100644 --- a/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationPopup.php @@ -26,88 +26,86 @@ namespace Thelia\Log\Destination; use Thelia\Log\AbstractTlogDestination; use Thelia\Log\TlogDestinationConfig; -class TlogDestinationPopup extends AbstractTlogDestination -{ - // Nom des variables de configuration - // ---------------------------------- - const VAR_POPUP_WIDTH = "tlog_destinationpopup_width"; - const VALEUR_POPUP_WIDTH_DEFAUT = "600"; +class TlogDestinationPopup extends AbstractTlogDestination { - const VAR_POPUP_HEIGHT = "tlog_destinationpopup_height"; - const VALEUR_POPUP_HEIGHT_DEFAUT = "600"; + // Nom des variables de configuration + // ---------------------------------- + const VAR_POPUP_WIDTH = "tlog_destinationpopup_width"; + const VALEUR_POPUP_WIDTH_DEFAUT = "600"; - const VAR_POPUP_TPL = "tlog_destinationpopup_template"; - // Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php - const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl"; + const VAR_POPUP_HEIGHT = "tlog_destinationpopup_height"; + const VALEUR_POPUP_HEIGHT_DEFAUT = "600"; - public function getTitle() - { - return "Javascript popup window"; - } + const VAR_POPUP_TPL = "tlog_destinationpopup_template"; + // Ce fichier doit se trouver dans le même répertoire que TlogDestinationPopup.class.php + const VALEUR_POPUP_TPL_DEFAUT = "TlogDestinationPopup.tpl"; - public function getDescription() - { - return "Display logs in a popup window, separate from the main window ."; - } + public function getTitle() { + return "Javascript popup window"; + } - public function getConfigs() - { - return array( - new TlogDestinationConfig( - self::VAR_POPUP_TPL, - "Popup windows template", - "Put #LOGTEXT in the template text where you want to display logs..", - file_get_contents(__DIR__.DS. self::VALEUR_POPUP_TPL_DEFAUT), - TlogDestinationConfig::TYPE_TEXTAREA - ), - new TlogDestinationConfig( - self::VAR_POPUP_HEIGHT, - "Height of the popup window", - "In pixels", - self::VALEUR_POPUP_HEIGHT_DEFAUT, - TlogDestinationConfig::TYPE_TEXTFIELD - ), - new TlogDestinationConfig( - self::VAR_POPUP_WIDTH, - "Width of the popup window", - "In pixels", - self::VALEUR_POPUP_WIDTH_DEFAUT, - TlogDestinationConfig::TYPE_TEXTFIELD - ) - ); - } + public function getDescription() { + return "Display logs in a popup window, separate from the main window ."; + } - public function write(&$res) - { - $content = ""; $count = 1; + public function getConfigs() { + return array( + new TlogDestinationConfig( + self::VAR_POPUP_TPL, + "Popup windows template", + "Put #LOGTEXT in the template text where you want to display logs..", + file_get_contents(__DIR__.DS. self::VALEUR_POPUP_TPL_DEFAUT), + TlogDestinationConfig::TYPE_TEXTAREA + ), + new TlogDestinationConfig( + self::VAR_POPUP_HEIGHT, + "Height of the popup window", + "In pixels", + self::VALEUR_POPUP_HEIGHT_DEFAUT, + TlogDestinationConfig::TYPE_TEXTFIELD + ), + new TlogDestinationConfig( + self::VAR_POPUP_WIDTH, + "Width of the popup window", + "In pixels", + self::VALEUR_POPUP_WIDTH_DEFAUT, + TlogDestinationConfig::TYPE_TEXTFIELD + ) + ); + } - foreach ($this->_logs as $line) { - $content .= "
".htmlspecialchars($line)."
"; - } + public function write(&$res) { - $tpl = $this->getConfig(self::VAR_POPUP_TPL); + $content = ""; $count = 1; - $tpl = str_replace('#LOGTEXT', $content, $tpl); - $tpl = str_replace(array("\r\n", "\r", "\n"), '\\n', $tpl); + foreach($this->_logs as $line) { + $content .= "
".htmlspecialchars($line)."
"; + } - $wop = sprintf(' - ', - $this->getConfig(self::VAR_POPUP_WIDTH), - $this->getConfig(self::VAR_POPUP_HEIGHT), - str_replace('"', '\\"', $tpl) - ); + $tpl = $this->getConfig(self::VAR_POPUP_TPL); - if (preg_match("||i", $res)) - $res = preg_replace("||i", "$wop\n", $res); - else - $res .= $wop; + $tpl = str_replace('#LOGTEXT', $content, $tpl); + $tpl = str_replace(array("\r\n", "\r", "\n"), '\\n', $tpl); + + $wop = sprintf(' + ', + $this->getConfig(self::VAR_POPUP_WIDTH), + $this->getConfig(self::VAR_POPUP_HEIGHT), + str_replace('"', '\\"', $tpl) + ); + + if (preg_match("||i", $res)) + $res = preg_replace("||i", "$wop\n", $res); + else + $res .= $wop; } } diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 139de9f26..86bd8bb29 100755 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -171,8 +171,7 @@ class Tlog Implements LoggerInterface * * @return array of directories */ - public function getDestinationsDirectories() - { + public function getDestinationsDirectories() { return $this->dir_destinations; } diff --git a/core/lib/Thelia/Log/TlogDestinationConfig.php b/core/lib/Thelia/Log/TlogDestinationConfig.php index cbc56fd33..01c8fbe4f 100755 --- a/core/lib/Thelia/Log/TlogDestinationConfig.php +++ b/core/lib/Thelia/Log/TlogDestinationConfig.php @@ -22,6 +22,7 @@ /*************************************************************************************/ namespace Thelia\Log; +use Thelia\Model\Config; use Thelia\Model\ConfigQuery; class TlogDestinationConfig diff --git a/core/lib/Thelia/Model/Base/Accessory.php b/core/lib/Thelia/Model/Base/Accessory.php index 5dfd4c91b..df3de2bc3 100644 --- a/core/lib/Thelia/Model/Base/Accessory.php +++ b/core/lib/Thelia/Model/Base/Accessory.php @@ -902,26 +902,26 @@ abstract class Accessory implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AccessoryTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AccessoryTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(AccessoryTableMap::ACCESSORY)) { - $modifiedColumns[':p' . $index++] = '`ACCESSORY`'; + $modifiedColumns[':p' . $index++] = 'ACCESSORY'; } if ($this->isColumnModified(AccessoryTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(AccessoryTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AccessoryTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `accessory` (%s) VALUES (%s)', + 'INSERT INTO accessory (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -930,22 +930,22 @@ abstract class Accessory implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`ACCESSORY`': + case 'ACCESSORY': $stmt->bindValue($identifier, $this->accessory, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AccessoryQuery.php b/core/lib/Thelia/Model/Base/AccessoryQuery.php index a79b73fbd..82bb03a70 100644 --- a/core/lib/Thelia/Model/Base/AccessoryQuery.php +++ b/core/lib/Thelia/Model/Base/AccessoryQuery.php @@ -151,7 +151,7 @@ abstract class AccessoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `ACCESSORY`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `accessory` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, ACCESSORY, POSITION, CREATED_AT, UPDATED_AT FROM accessory WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Address.php b/core/lib/Thelia/Model/Base/Address.php index 98a346969..47bcd35a3 100644 --- a/core/lib/Thelia/Model/Base/Address.php +++ b/core/lib/Thelia/Model/Base/Address.php @@ -1503,62 +1503,62 @@ abstract class Address implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AddressTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AddressTableMap::LABEL)) { - $modifiedColumns[':p' . $index++] = '`LABEL`'; + $modifiedColumns[':p' . $index++] = 'LABEL'; } if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) { - $modifiedColumns[':p' . $index++] = '`CUSTOMER_ID`'; + $modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; } if ($this->isColumnModified(AddressTableMap::TITLE_ID)) { - $modifiedColumns[':p' . $index++] = '`TITLE_ID`'; + $modifiedColumns[':p' . $index++] = 'TITLE_ID'; } if ($this->isColumnModified(AddressTableMap::COMPANY)) { - $modifiedColumns[':p' . $index++] = '`COMPANY`'; + $modifiedColumns[':p' . $index++] = 'COMPANY'; } if ($this->isColumnModified(AddressTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; } if ($this->isColumnModified(AddressTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'LASTNAME'; } if ($this->isColumnModified(AddressTableMap::ADDRESS1)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS1`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS1'; } if ($this->isColumnModified(AddressTableMap::ADDRESS2)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS2`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS2'; } if ($this->isColumnModified(AddressTableMap::ADDRESS3)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS3`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS3'; } if ($this->isColumnModified(AddressTableMap::ZIPCODE)) { - $modifiedColumns[':p' . $index++] = '`ZIPCODE`'; + $modifiedColumns[':p' . $index++] = 'ZIPCODE'; } if ($this->isColumnModified(AddressTableMap::CITY)) { - $modifiedColumns[':p' . $index++] = '`CITY`'; + $modifiedColumns[':p' . $index++] = 'CITY'; } if ($this->isColumnModified(AddressTableMap::COUNTRY_ID)) { - $modifiedColumns[':p' . $index++] = '`COUNTRY_ID`'; + $modifiedColumns[':p' . $index++] = 'COUNTRY_ID'; } if ($this->isColumnModified(AddressTableMap::PHONE)) { - $modifiedColumns[':p' . $index++] = '`PHONE`'; + $modifiedColumns[':p' . $index++] = 'PHONE'; } if ($this->isColumnModified(AddressTableMap::CELLPHONE)) { - $modifiedColumns[':p' . $index++] = '`CELLPHONE`'; + $modifiedColumns[':p' . $index++] = 'CELLPHONE'; } if ($this->isColumnModified(AddressTableMap::IS_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`IS_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'IS_DEFAULT'; } if ($this->isColumnModified(AddressTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AddressTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `address` (%s) VALUES (%s)', + 'INSERT INTO address (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1567,58 +1567,58 @@ abstract class Address implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LABEL`': + case 'LABEL': $stmt->bindValue($identifier, $this->label, PDO::PARAM_STR); break; - case '`CUSTOMER_ID`': + case 'CUSTOMER_ID': $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); break; - case '`TITLE_ID`': + case 'TITLE_ID': $stmt->bindValue($identifier, $this->title_id, PDO::PARAM_INT); break; - case '`COMPANY`': + case 'COMPANY': $stmt->bindValue($identifier, $this->company, PDO::PARAM_STR); break; - case '`FIRSTNAME`': + case 'FIRSTNAME': $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); break; - case '`LASTNAME`': + case 'LASTNAME': $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); break; - case '`ADDRESS1`': + case 'ADDRESS1': $stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR); break; - case '`ADDRESS2`': + case 'ADDRESS2': $stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR); break; - case '`ADDRESS3`': + case 'ADDRESS3': $stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR); break; - case '`ZIPCODE`': + case 'ZIPCODE': $stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR); break; - case '`CITY`': + case 'CITY': $stmt->bindValue($identifier, $this->city, PDO::PARAM_STR); break; - case '`COUNTRY_ID`': + case 'COUNTRY_ID': $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT); break; - case '`PHONE`': + case 'PHONE': $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); break; - case '`CELLPHONE`': + case 'CELLPHONE': $stmt->bindValue($identifier, $this->cellphone, PDO::PARAM_STR); break; - case '`IS_DEFAULT`': + case 'IS_DEFAULT': $stmt->bindValue($identifier, $this->is_default, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AddressQuery.php b/core/lib/Thelia/Model/Base/AddressQuery.php index 40d15fd96..dc6827868 100644 --- a/core/lib/Thelia/Model/Base/AddressQuery.php +++ b/core/lib/Thelia/Model/Base/AddressQuery.php @@ -211,7 +211,7 @@ abstract class AddressQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Admin.php b/core/lib/Thelia/Model/Base/Admin.php index 4342ae90f..cb1295c3f 100644 --- a/core/lib/Thelia/Model/Base/Admin.php +++ b/core/lib/Thelia/Model/Base/Admin.php @@ -1128,44 +1128,44 @@ abstract class Admin implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AdminTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AdminTableMap::PROFILE_ID)) { - $modifiedColumns[':p' . $index++] = '`PROFILE_ID`'; + $modifiedColumns[':p' . $index++] = 'PROFILE_ID'; } if ($this->isColumnModified(AdminTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; } if ($this->isColumnModified(AdminTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'LASTNAME'; } if ($this->isColumnModified(AdminTableMap::LOGIN)) { - $modifiedColumns[':p' . $index++] = '`LOGIN`'; + $modifiedColumns[':p' . $index++] = 'LOGIN'; } if ($this->isColumnModified(AdminTableMap::PASSWORD)) { - $modifiedColumns[':p' . $index++] = '`PASSWORD`'; + $modifiedColumns[':p' . $index++] = 'PASSWORD'; } if ($this->isColumnModified(AdminTableMap::ALGO)) { - $modifiedColumns[':p' . $index++] = '`ALGO`'; + $modifiedColumns[':p' . $index++] = 'ALGO'; } if ($this->isColumnModified(AdminTableMap::SALT)) { - $modifiedColumns[':p' . $index++] = '`SALT`'; + $modifiedColumns[':p' . $index++] = 'SALT'; } 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)) { - $modifiedColumns[':p' . $index++] = '`REMEMBER_ME_SERIAL`'; + $modifiedColumns[':p' . $index++] = 'REMEMBER_ME_SERIAL'; } if ($this->isColumnModified(AdminTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AdminTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `admin` (%s) VALUES (%s)', + 'INSERT INTO admin (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1174,40 +1174,40 @@ abstract class Admin implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PROFILE_ID`': + case 'PROFILE_ID': $stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT); break; - case '`FIRSTNAME`': + case 'FIRSTNAME': $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); break; - case '`LASTNAME`': + case 'LASTNAME': $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); break; - case '`LOGIN`': + case 'LOGIN': $stmt->bindValue($identifier, $this->login, PDO::PARAM_STR); break; - case '`PASSWORD`': + case 'PASSWORD': $stmt->bindValue($identifier, $this->password, PDO::PARAM_STR); break; - case '`ALGO`': + case 'ALGO': $stmt->bindValue($identifier, $this->algo, PDO::PARAM_STR); break; - case '`SALT`': + case 'SALT': $stmt->bindValue($identifier, $this->salt, PDO::PARAM_STR); break; - case '`REMEMBER_ME_TOKEN`': + case 'REMEMBER_ME_TOKEN': $stmt->bindValue($identifier, $this->remember_me_token, PDO::PARAM_STR); break; - case '`REMEMBER_ME_SERIAL`': + case 'REMEMBER_ME_SERIAL': $stmt->bindValue($identifier, $this->remember_me_serial, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AdminLog.php b/core/lib/Thelia/Model/Base/AdminLog.php index 346011916..abebb7cd9 100644 --- a/core/lib/Thelia/Model/Base/AdminLog.php +++ b/core/lib/Thelia/Model/Base/AdminLog.php @@ -1019,38 +1019,38 @@ abstract class AdminLog implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AdminLogTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AdminLogTableMap::ADMIN_LOGIN)) { - $modifiedColumns[':p' . $index++] = '`ADMIN_LOGIN`'; + $modifiedColumns[':p' . $index++] = 'ADMIN_LOGIN'; } if ($this->isColumnModified(AdminLogTableMap::ADMIN_FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`ADMIN_FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'ADMIN_FIRSTNAME'; } if ($this->isColumnModified(AdminLogTableMap::ADMIN_LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`ADMIN_LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'ADMIN_LASTNAME'; } if ($this->isColumnModified(AdminLogTableMap::RESOURCE)) { - $modifiedColumns[':p' . $index++] = '`RESOURCE`'; + $modifiedColumns[':p' . $index++] = 'RESOURCE'; } if ($this->isColumnModified(AdminLogTableMap::ACTION)) { - $modifiedColumns[':p' . $index++] = '`ACTION`'; + $modifiedColumns[':p' . $index++] = 'ACTION'; } if ($this->isColumnModified(AdminLogTableMap::MESSAGE)) { - $modifiedColumns[':p' . $index++] = '`MESSAGE`'; + $modifiedColumns[':p' . $index++] = 'MESSAGE'; } if ($this->isColumnModified(AdminLogTableMap::REQUEST)) { - $modifiedColumns[':p' . $index++] = '`REQUEST`'; + $modifiedColumns[':p' . $index++] = 'REQUEST'; } if ($this->isColumnModified(AdminLogTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AdminLogTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `admin_log` (%s) VALUES (%s)', + 'INSERT INTO admin_log (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1059,34 +1059,34 @@ abstract class AdminLog implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ADMIN_LOGIN`': + case 'ADMIN_LOGIN': $stmt->bindValue($identifier, $this->admin_login, PDO::PARAM_STR); break; - case '`ADMIN_FIRSTNAME`': + case 'ADMIN_FIRSTNAME': $stmt->bindValue($identifier, $this->admin_firstname, PDO::PARAM_STR); break; - case '`ADMIN_LASTNAME`': + case 'ADMIN_LASTNAME': $stmt->bindValue($identifier, $this->admin_lastname, PDO::PARAM_STR); break; - case '`RESOURCE`': + case 'RESOURCE': $stmt->bindValue($identifier, $this->resource, PDO::PARAM_STR); break; - case '`ACTION`': + case 'ACTION': $stmt->bindValue($identifier, $this->action, PDO::PARAM_STR); break; - case '`MESSAGE`': + case 'MESSAGE': $stmt->bindValue($identifier, $this->message, PDO::PARAM_STR); break; - case '`REQUEST`': + case 'REQUEST': $stmt->bindValue($identifier, $this->request, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AdminLogQuery.php b/core/lib/Thelia/Model/Base/AdminLogQuery.php index de0a8771f..061b9013d 100644 --- a/core/lib/Thelia/Model/Base/AdminLogQuery.php +++ b/core/lib/Thelia/Model/Base/AdminLogQuery.php @@ -156,7 +156,7 @@ abstract class AdminLogQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AdminQuery.php b/core/lib/Thelia/Model/Base/AdminQuery.php index 0ec88d23e..d9f032544 100644 --- a/core/lib/Thelia/Model/Base/AdminQuery.php +++ b/core/lib/Thelia/Model/Base/AdminQuery.php @@ -171,7 +171,7 @@ abstract class AdminQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Area.php b/core/lib/Thelia/Model/Base/Area.php index b0efba572..14d834929 100644 --- a/core/lib/Thelia/Model/Base/Area.php +++ b/core/lib/Thelia/Model/Base/Area.php @@ -882,23 +882,23 @@ abstract class Area implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AreaTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AreaTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } if ($this->isColumnModified(AreaTableMap::POSTAGE)) { - $modifiedColumns[':p' . $index++] = '`POSTAGE`'; + $modifiedColumns[':p' . $index++] = 'POSTAGE'; } if ($this->isColumnModified(AreaTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AreaTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `area` (%s) VALUES (%s)', + 'INSERT INTO area (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -907,19 +907,19 @@ abstract class Area implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; - case '`POSTAGE`': + case 'POSTAGE': $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AreaDeliveryModule.php b/core/lib/Thelia/Model/Base/AreaDeliveryModule.php index 2873ca946..1e2996fb4 100644 --- a/core/lib/Thelia/Model/Base/AreaDeliveryModule.php +++ b/core/lib/Thelia/Model/Base/AreaDeliveryModule.php @@ -863,23 +863,23 @@ abstract class AreaDeliveryModule implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AreaDeliveryModuleTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AreaDeliveryModuleTableMap::AREA_ID)) { - $modifiedColumns[':p' . $index++] = '`AREA_ID`'; + $modifiedColumns[':p' . $index++] = 'AREA_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)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AreaDeliveryModuleTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `area_delivery_module` (%s) VALUES (%s)', + 'INSERT INTO area_delivery_module (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -888,19 +888,19 @@ abstract class AreaDeliveryModule implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`AREA_ID`': + case 'AREA_ID': $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT); break; - case '`DELIVERY_MODULE_ID`': + case 'DELIVERY_MODULE_ID': $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AreaDeliveryModuleQuery.php b/core/lib/Thelia/Model/Base/AreaDeliveryModuleQuery.php index 2d21d28e0..394fe651e 100644 --- a/core/lib/Thelia/Model/Base/AreaDeliveryModuleQuery.php +++ b/core/lib/Thelia/Model/Base/AreaDeliveryModuleQuery.php @@ -147,7 +147,7 @@ abstract class AreaDeliveryModuleQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AreaQuery.php b/core/lib/Thelia/Model/Base/AreaQuery.php index e1033e576..ea4cd8b90 100644 --- a/core/lib/Thelia/Model/Base/AreaQuery.php +++ b/core/lib/Thelia/Model/Base/AreaQuery.php @@ -147,7 +147,7 @@ abstract class AreaQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Attribute.php b/core/lib/Thelia/Model/Base/Attribute.php index 9e1fc6c9c..f9cee31c7 100644 --- a/core/lib/Thelia/Model/Base/Attribute.php +++ b/core/lib/Thelia/Model/Base/Attribute.php @@ -961,20 +961,20 @@ abstract class Attribute implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AttributeTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(AttributeTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AttributeTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `attribute` (%s) VALUES (%s)', + 'INSERT INTO attribute (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -983,16 +983,16 @@ abstract class Attribute implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeAv.php b/core/lib/Thelia/Model/Base/AttributeAv.php index e92a8cd12..83b55fab8 100644 --- a/core/lib/Thelia/Model/Base/AttributeAv.php +++ b/core/lib/Thelia/Model/Base/AttributeAv.php @@ -922,23 +922,23 @@ abstract class AttributeAv implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeAvTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AttributeAvTableMap::ATTRIBUTE_ID)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID'; } if ($this->isColumnModified(AttributeAvTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(AttributeAvTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AttributeAvTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `attribute_av` (%s) VALUES (%s)', + 'INSERT INTO attribute_av (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -947,19 +947,19 @@ abstract class AttributeAv implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ATTRIBUTE_ID`': + case 'ATTRIBUTE_ID': $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeAvI18n.php b/core/lib/Thelia/Model/Base/AttributeAvI18n.php index 106dee40c..dd2a973b7 100644 --- a/core/lib/Thelia/Model/Base/AttributeAvI18n.php +++ b/core/lib/Thelia/Model/Base/AttributeAvI18n.php @@ -858,26 +858,26 @@ abstract class AttributeAvI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeAvI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AttributeAvI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(AttributeAvI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(AttributeAvI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(AttributeAvI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(AttributeAvI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `attribute_av_i18n` (%s) VALUES (%s)', + 'INSERT INTO attribute_av_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class AttributeAvI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php b/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php index df90b3baa..943e453a9 100644 --- a/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeAvI18nQuery.php @@ -147,7 +147,7 @@ abstract class AttributeAvI18nQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AttributeAvQuery.php b/core/lib/Thelia/Model/Base/AttributeAvQuery.php index d0227b7c9..8ebfaa8c9 100644 --- a/core/lib/Thelia/Model/Base/AttributeAvQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeAvQuery.php @@ -152,7 +152,7 @@ abstract class AttributeAvQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `ATTRIBUTE_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `attribute_av` WHERE `ID` = :p0'; + $sql = 'SELECT ID, ATTRIBUTE_ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute_av WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AttributeCombination.php b/core/lib/Thelia/Model/Base/AttributeCombination.php index 7db295561..543e86476 100644 --- a/core/lib/Thelia/Model/Base/AttributeCombination.php +++ b/core/lib/Thelia/Model/Base/AttributeCombination.php @@ -881,23 +881,23 @@ abstract class AttributeCombination implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeCombinationTableMap::ATTRIBUTE_ID)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_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)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_SALE_ELEMENTS_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID'; } if ($this->isColumnModified(AttributeCombinationTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AttributeCombinationTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `attribute_combination` (%s) VALUES (%s)', + 'INSERT INTO attribute_combination (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -906,19 +906,19 @@ abstract class AttributeCombination implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ATTRIBUTE_ID`': + case 'ATTRIBUTE_ID': $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); break; - case '`ATTRIBUTE_AV_ID`': + case 'ATTRIBUTE_AV_ID': $stmt->bindValue($identifier, $this->attribute_av_id, PDO::PARAM_INT); break; - case '`PRODUCT_SALE_ELEMENTS_ID`': + case 'PRODUCT_SALE_ELEMENTS_ID': $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php b/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php index d77286e11..291ff7725 100644 --- a/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeCombinationQuery.php @@ -151,7 +151,7 @@ abstract class AttributeCombinationQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AttributeI18n.php b/core/lib/Thelia/Model/Base/AttributeI18n.php index f5cd9c6af..30bd331a3 100644 --- a/core/lib/Thelia/Model/Base/AttributeI18n.php +++ b/core/lib/Thelia/Model/Base/AttributeI18n.php @@ -858,26 +858,26 @@ abstract class AttributeI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AttributeI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(AttributeI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(AttributeI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(AttributeI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(AttributeI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `attribute_i18n` (%s) VALUES (%s)', + 'INSERT INTO attribute_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class AttributeI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeI18nQuery.php b/core/lib/Thelia/Model/Base/AttributeI18nQuery.php index 5b7f05df5..c553af9a2 100644 --- a/core/lib/Thelia/Model/Base/AttributeI18nQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeI18nQuery.php @@ -147,7 +147,7 @@ abstract class AttributeI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `attribute_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM attribute_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AttributeQuery.php b/core/lib/Thelia/Model/Base/AttributeQuery.php index a2f2b6915..b496289f8 100644 --- a/core/lib/Thelia/Model/Base/AttributeQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeQuery.php @@ -152,7 +152,7 @@ abstract class AttributeQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `attribute` WHERE `ID` = :p0'; + $sql = 'SELECT ID, POSITION, CREATED_AT, UPDATED_AT FROM attribute WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/AttributeTemplate.php b/core/lib/Thelia/Model/Base/AttributeTemplate.php index ea3032359..ae45495ee 100644 --- a/core/lib/Thelia/Model/Base/AttributeTemplate.php +++ b/core/lib/Thelia/Model/Base/AttributeTemplate.php @@ -904,26 +904,26 @@ abstract class AttributeTemplate implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(AttributeTemplateTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(AttributeTemplateTableMap::ATTRIBUTE_ID)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_ID`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_ID'; } if ($this->isColumnModified(AttributeTemplateTableMap::TEMPLATE_ID)) { - $modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`'; + $modifiedColumns[':p' . $index++] = 'TEMPLATE_ID'; } if ($this->isColumnModified(AttributeTemplateTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(AttributeTemplateTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(AttributeTemplateTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `attribute_template` (%s) VALUES (%s)', + 'INSERT INTO attribute_template (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -932,22 +932,22 @@ abstract class AttributeTemplate implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ATTRIBUTE_ID`': + case 'ATTRIBUTE_ID': $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT); break; - case '`TEMPLATE_ID`': + case 'TEMPLATE_ID': $stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/AttributeTemplateQuery.php b/core/lib/Thelia/Model/Base/AttributeTemplateQuery.php index bbfd77ebb..e1a8d0320 100644 --- a/core/lib/Thelia/Model/Base/AttributeTemplateQuery.php +++ b/core/lib/Thelia/Model/Base/AttributeTemplateQuery.php @@ -151,7 +151,7 @@ abstract class AttributeTemplateQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Cart.php b/core/lib/Thelia/Model/Base/Cart.php index 446eae129..96880be66 100644 --- a/core/lib/Thelia/Model/Base/Cart.php +++ b/core/lib/Thelia/Model/Base/Cart.php @@ -1121,35 +1121,35 @@ abstract class Cart implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CartTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CartTableMap::TOKEN)) { - $modifiedColumns[':p' . $index++] = '`TOKEN`'; + $modifiedColumns[':p' . $index++] = 'TOKEN'; } if ($this->isColumnModified(CartTableMap::CUSTOMER_ID)) { - $modifiedColumns[':p' . $index++] = '`CUSTOMER_ID`'; + $modifiedColumns[':p' . $index++] = 'CUSTOMER_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)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS_INVOICE_ID`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS_INVOICE_ID'; } if ($this->isColumnModified(CartTableMap::CURRENCY_ID)) { - $modifiedColumns[':p' . $index++] = '`CURRENCY_ID`'; + $modifiedColumns[':p' . $index++] = 'CURRENCY_ID'; } if ($this->isColumnModified(CartTableMap::DISCOUNT)) { - $modifiedColumns[':p' . $index++] = '`DISCOUNT`'; + $modifiedColumns[':p' . $index++] = 'DISCOUNT'; } if ($this->isColumnModified(CartTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CartTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `cart` (%s) VALUES (%s)', + 'INSERT INTO cart (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1158,31 +1158,31 @@ abstract class Cart implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`TOKEN`': + case 'TOKEN': $stmt->bindValue($identifier, $this->token, PDO::PARAM_STR); break; - case '`CUSTOMER_ID`': + case 'CUSTOMER_ID': $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); break; - case '`ADDRESS_DELIVERY_ID`': + case 'ADDRESS_DELIVERY_ID': $stmt->bindValue($identifier, $this->address_delivery_id, PDO::PARAM_INT); break; - case '`ADDRESS_INVOICE_ID`': + case 'ADDRESS_INVOICE_ID': $stmt->bindValue($identifier, $this->address_invoice_id, PDO::PARAM_INT); break; - case '`CURRENCY_ID`': + case 'CURRENCY_ID': $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT); break; - case '`DISCOUNT`': + case 'DISCOUNT': $stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CartItem.php b/core/lib/Thelia/Model/Base/CartItem.php index 6b074e4e3..53b3ef411 100644 --- a/core/lib/Thelia/Model/Base/CartItem.php +++ b/core/lib/Thelia/Model/Base/CartItem.php @@ -109,6 +109,13 @@ abstract class CartItem implements ActiveRecordInterface */ 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. * @var int @@ -159,6 +166,7 @@ abstract class CartItem implements ActiveRecordInterface public function applyDefaultValues() { $this->quantity = 1; + $this->discount = 0; } /** @@ -518,6 +526,17 @@ abstract class CartItem implements ActiveRecordInterface } } + /** + * Get the [discount] column value. + * + * @return double + */ + public function getDiscount() + { + + return $this->discount; + } + /** * Get the [promo] column value. * @@ -749,6 +768,27 @@ abstract class CartItem implements ActiveRecordInterface return $this; } // 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. * @@ -826,6 +866,10 @@ abstract class CartItem implements ActiveRecordInterface return false; } + if ($this->discount !== 0) { + return false; + } + // otherwise, everything was equal, so return TRUE return true; } // hasOnlyDefaultValues() @@ -880,16 +924,19 @@ abstract class CartItem implements ActiveRecordInterface } $this->price_end_of_life = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('Promo', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : CartItemTableMap::translateFieldName('Discount', 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; - $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CartItemTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : CartItemTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -902,7 +949,7 @@ abstract class CartItem implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 11; // 11 = CartItemTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 12; // 12 = CartItemTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\CartItem object", 0, $e); @@ -1161,41 +1208,44 @@ abstract class CartItem implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CartItemTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CartItemTableMap::CART_ID)) { - $modifiedColumns[':p' . $index++] = '`CART_ID`'; + $modifiedColumns[':p' . $index++] = 'CART_ID'; } if ($this->isColumnModified(CartItemTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(CartItemTableMap::QUANTITY)) { - $modifiedColumns[':p' . $index++] = '`QUANTITY`'; + $modifiedColumns[':p' . $index++] = 'QUANTITY'; } 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)) { - $modifiedColumns[':p' . $index++] = '`PRICE`'; + $modifiedColumns[':p' . $index++] = '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)) { - $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)) { - $modifiedColumns[':p' . $index++] = '`PROMO`'; + $modifiedColumns[':p' . $index++] = 'PROMO'; } if ($this->isColumnModified(CartItemTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `cart_item` (%s) VALUES (%s)', + 'INSERT INTO cart_item (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1204,37 +1254,40 @@ abstract class CartItem implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CART_ID`': + case 'CART_ID': $stmt->bindValue($identifier, $this->cart_id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`QUANTITY`': + case 'QUANTITY': $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR); break; - case '`PRODUCT_SALE_ELEMENTS_ID`': + case 'PRODUCT_SALE_ELEMENTS_ID': $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT); break; - case '`PRICE`': + case 'PRICE': $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR); break; - case '`PROMO_PRICE`': + case 'PROMO_PRICE': $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR); 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); break; - case '`PROMO`': + case 'DISCOUNT': + $stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR); + break; + case 'PROMO': $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT); 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); 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); break; } @@ -1324,12 +1377,15 @@ abstract class CartItem implements ActiveRecordInterface return $this->getPriceEndOfLife(); break; case 8: - return $this->getPromo(); + return $this->getDiscount(); break; case 9: - return $this->getCreatedAt(); + return $this->getPromo(); break; case 10: + return $this->getCreatedAt(); + break; + case 11: return $this->getUpdatedAt(); break; default: @@ -1369,9 +1425,10 @@ abstract class CartItem implements ActiveRecordInterface $keys[5] => $this->getPrice(), $keys[6] => $this->getPromoPrice(), $keys[7] => $this->getPriceEndOfLife(), - $keys[8] => $this->getPromo(), - $keys[9] => $this->getCreatedAt(), - $keys[10] => $this->getUpdatedAt(), + $keys[8] => $this->getDiscount(), + $keys[9] => $this->getPromo(), + $keys[10] => $this->getCreatedAt(), + $keys[11] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1447,12 +1504,15 @@ abstract class CartItem implements ActiveRecordInterface $this->setPriceEndOfLife($value); break; case 8: - $this->setPromo($value); + $this->setDiscount($value); break; case 9: - $this->setCreatedAt($value); + $this->setPromo($value); break; case 10: + $this->setCreatedAt($value); + break; + case 11: $this->setUpdatedAt($value); break; } // switch() @@ -1487,9 +1547,10 @@ abstract class CartItem implements ActiveRecordInterface 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[7], $arr)) $this->setPriceEndOfLife($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setPromo($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]); + if (array_key_exists($keys[8], $arr)) $this->setDiscount($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setPromo($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]); + if (array_key_exists($keys[11], $arr)) $this->setUpdatedAt($arr[$keys[11]]); } /** @@ -1509,6 +1570,7 @@ abstract class CartItem implements ActiveRecordInterface 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::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::CREATED_AT)) $criteria->add(CartItemTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(CartItemTableMap::UPDATED_AT)) $criteria->add(CartItemTableMap::UPDATED_AT, $this->updated_at); @@ -1582,6 +1644,7 @@ abstract class CartItem implements ActiveRecordInterface $copyObj->setPrice($this->getPrice()); $copyObj->setPromoPrice($this->getPromoPrice()); $copyObj->setPriceEndOfLife($this->getPriceEndOfLife()); + $copyObj->setDiscount($this->getDiscount()); $copyObj->setPromo($this->getPromo()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1779,6 +1842,7 @@ abstract class CartItem implements ActiveRecordInterface $this->price = null; $this->promo_price = null; $this->price_end_of_life = null; + $this->discount = null; $this->promo = null; $this->created_at = null; $this->updated_at = null; diff --git a/core/lib/Thelia/Model/Base/CartItemQuery.php b/core/lib/Thelia/Model/Base/CartItemQuery.php index 9e7e675d1..79d5d3cfe 100644 --- a/core/lib/Thelia/Model/Base/CartItemQuery.php +++ b/core/lib/Thelia/Model/Base/CartItemQuery.php @@ -29,6 +29,7 @@ use Thelia\Model\Map\CartItemTableMap; * @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 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 orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildCartItemQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column @@ -41,6 +42,7 @@ use Thelia\Model\Map\CartItemTableMap; * @method ChildCartItemQuery groupByPrice() Group by the price column * @method ChildCartItemQuery groupByPromoPrice() Group by the promo_price 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 groupByCreatedAt() Group by the created_at column * @method ChildCartItemQuery groupByUpdatedAt() Group by the updated_at column @@ -72,6 +74,7 @@ use Thelia\Model\Map\CartItemTableMap; * @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 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 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 @@ -84,6 +87,7 @@ use Thelia\Model\Map\CartItemTableMap; * @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 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 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 @@ -175,7 +179,7 @@ abstract class CartItemQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $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'; + $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'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -600,6 +604,47 @@ abstract class CartItemQuery extends ModelCriteria return $this->addUsingAlias(CartItemTableMap::PRICE_END_OF_LIFE, $priceEndOfLife, $comparison); } + /** + * Filter the query on the discount column + * + * Example usage: + * + * $query->filterByDiscount(1234); // WHERE discount = 1234 + * $query->filterByDiscount(array(12, 34)); // WHERE discount IN (12, 34) + * $query->filterByDiscount(array('min' => 12)); // WHERE discount > 12 + * + * + * @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 * diff --git a/core/lib/Thelia/Model/Base/CartQuery.php b/core/lib/Thelia/Model/Base/CartQuery.php index 9fbd97a12..2628aa893 100644 --- a/core/lib/Thelia/Model/Base/CartQuery.php +++ b/core/lib/Thelia/Model/Base/CartQuery.php @@ -175,7 +175,7 @@ abstract class CartQuery extends ModelCriteria */ 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 { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Category.php b/core/lib/Thelia/Model/Base/Category.php index 8b3cbceaf..aacf774c0 100644 --- a/core/lib/Thelia/Model/Base/Category.php +++ b/core/lib/Thelia/Model/Base/Category.php @@ -1283,35 +1283,35 @@ abstract class Category implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryTableMap::PARENT)) { - $modifiedColumns[':p' . $index++] = '`PARENT`'; + $modifiedColumns[':p' . $index++] = 'PARENT'; } if ($this->isColumnModified(CategoryTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(CategoryTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CategoryTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CategoryTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(CategoryTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } 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)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `category` (%s) VALUES (%s)', + 'INSERT INTO category (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1320,31 +1320,31 @@ abstract class Category implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PARENT`': + case 'PARENT': $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryAssociatedContent.php b/core/lib/Thelia/Model/Base/CategoryAssociatedContent.php index 31f7b0b6e..8079eb563 100644 --- a/core/lib/Thelia/Model/Base/CategoryAssociatedContent.php +++ b/core/lib/Thelia/Model/Base/CategoryAssociatedContent.php @@ -904,26 +904,26 @@ abstract class CategoryAssociatedContent implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryAssociatedContentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryAssociatedContentTableMap::CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`CATEGORY_ID`'; + $modifiedColumns[':p' . $index++] = 'CATEGORY_ID'; } if ($this->isColumnModified(CategoryAssociatedContentTableMap::CONTENT_ID)) { - $modifiedColumns[':p' . $index++] = '`CONTENT_ID`'; + $modifiedColumns[':p' . $index++] = 'CONTENT_ID'; } if ($this->isColumnModified(CategoryAssociatedContentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CategoryAssociatedContentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CategoryAssociatedContentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `category_associated_content` (%s) VALUES (%s)', + 'INSERT INTO category_associated_content (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -932,22 +932,22 @@ abstract class CategoryAssociatedContent implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CATEGORY_ID`': + case 'CATEGORY_ID': $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT); break; - case '`CONTENT_ID`': + case 'CONTENT_ID': $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryAssociatedContentQuery.php b/core/lib/Thelia/Model/Base/CategoryAssociatedContentQuery.php index dd5238d83..bb03306f4 100644 --- a/core/lib/Thelia/Model/Base/CategoryAssociatedContentQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryAssociatedContentQuery.php @@ -151,7 +151,7 @@ abstract class CategoryAssociatedContentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CATEGORY_ID`, `CONTENT_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `category_associated_content` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CATEGORY_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM category_associated_content WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryDocument.php b/core/lib/Thelia/Model/Base/CategoryDocument.php index c39cf631a..83660e717 100644 --- a/core/lib/Thelia/Model/Base/CategoryDocument.php +++ b/core/lib/Thelia/Model/Base/CategoryDocument.php @@ -930,26 +930,26 @@ abstract class CategoryDocument implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryDocumentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryDocumentTableMap::CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`CATEGORY_ID`'; + $modifiedColumns[':p' . $index++] = 'CATEGORY_ID'; } if ($this->isColumnModified(CategoryDocumentTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(CategoryDocumentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CategoryDocumentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CategoryDocumentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `category_document` (%s) VALUES (%s)', + 'INSERT INTO category_document (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class CategoryDocument implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CATEGORY_ID`': + case 'CATEGORY_ID': $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php b/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php index 24f29f985..c4348da52 100644 --- a/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryDocumentI18n.php @@ -858,26 +858,26 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryDocumentI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryDocumentI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CategoryDocumentI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(CategoryDocumentI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(CategoryDocumentI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(CategoryDocumentI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `category_document_i18n` (%s) VALUES (%s)', + 'INSERT INTO category_document_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class CategoryDocumentI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php b/core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php index d9dc050aa..a8c6000dc 100644 --- a/core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryDocumentI18nQuery.php @@ -147,7 +147,7 @@ abstract class CategoryDocumentI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `category_document_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_document_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php b/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php index 55fb01406..8c0a177ac 100644 --- a/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryDocumentQuery.php @@ -152,7 +152,7 @@ abstract class CategoryDocumentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CATEGORY_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `category_document` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_document WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryI18n.php b/core/lib/Thelia/Model/Base/CategoryI18n.php index 873d152a1..0eb196d29 100644 --- a/core/lib/Thelia/Model/Base/CategoryI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryI18n.php @@ -981,35 +981,35 @@ abstract class CategoryI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CategoryI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(CategoryI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(CategoryI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(CategoryI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } if ($this->isColumnModified(CategoryI18nTableMap::META_TITLE)) { - $modifiedColumns[':p' . $index++] = '`META_TITLE`'; + $modifiedColumns[':p' . $index++] = 'META_TITLE'; } if ($this->isColumnModified(CategoryI18nTableMap::META_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`META_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'META_DESCRIPTION'; } if ($this->isColumnModified(CategoryI18nTableMap::META_KEYWORDS)) { - $modifiedColumns[':p' . $index++] = '`META_KEYWORDS`'; + $modifiedColumns[':p' . $index++] = 'META_KEYWORDS'; } $sql = sprintf( - 'INSERT INTO `category_i18n` (%s) VALUES (%s)', + 'INSERT INTO category_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1018,31 +1018,31 @@ abstract class CategoryI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; - case '`META_TITLE`': + case 'META_TITLE': $stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR); break; - case '`META_DESCRIPTION`': + case 'META_DESCRIPTION': $stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR); break; - case '`META_KEYWORDS`': + case 'META_KEYWORDS': $stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryI18nQuery.php b/core/lib/Thelia/Model/Base/CategoryI18nQuery.php index 68a692f2d..44ef90de3 100644 --- a/core/lib/Thelia/Model/Base/CategoryI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryI18nQuery.php @@ -159,7 +159,7 @@ abstract class CategoryI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS` FROM `category_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM category_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryImage.php b/core/lib/Thelia/Model/Base/CategoryImage.php index 04963495f..2a7e826c7 100644 --- a/core/lib/Thelia/Model/Base/CategoryImage.php +++ b/core/lib/Thelia/Model/Base/CategoryImage.php @@ -930,26 +930,26 @@ abstract class CategoryImage implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryImageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryImageTableMap::CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`CATEGORY_ID`'; + $modifiedColumns[':p' . $index++] = 'CATEGORY_ID'; } if ($this->isColumnModified(CategoryImageTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(CategoryImageTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CategoryImageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CategoryImageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `category_image` (%s) VALUES (%s)', + 'INSERT INTO category_image (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class CategoryImage implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CATEGORY_ID`': + case 'CATEGORY_ID': $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryImageI18n.php b/core/lib/Thelia/Model/Base/CategoryImageI18n.php index 73b9e6037..1197930c8 100644 --- a/core/lib/Thelia/Model/Base/CategoryImageI18n.php +++ b/core/lib/Thelia/Model/Base/CategoryImageI18n.php @@ -858,26 +858,26 @@ abstract class CategoryImageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryImageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryImageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CategoryImageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(CategoryImageI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(CategoryImageI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(CategoryImageI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `category_image_i18n` (%s) VALUES (%s)', + 'INSERT INTO category_image_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class CategoryImageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php b/core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php index 424a478cf..6d552e808 100644 --- a/core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryImageI18nQuery.php @@ -147,7 +147,7 @@ abstract class CategoryImageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `category_image_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM category_image_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryImageQuery.php b/core/lib/Thelia/Model/Base/CategoryImageQuery.php index af219e055..2130e757b 100644 --- a/core/lib/Thelia/Model/Base/CategoryImageQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryImageQuery.php @@ -152,7 +152,7 @@ abstract class CategoryImageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CATEGORY_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `category_image` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CATEGORY_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM category_image WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryQuery.php b/core/lib/Thelia/Model/Base/CategoryQuery.php index 5cd4bc8f9..4ef552094 100644 --- a/core/lib/Thelia/Model/Base/CategoryQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryQuery.php @@ -187,7 +187,7 @@ abstract class CategoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PARENT`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `category` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PARENT, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM category WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CategoryVersion.php b/core/lib/Thelia/Model/Base/CategoryVersion.php index 110844ba0..7abd40b21 100644 --- a/core/lib/Thelia/Model/Base/CategoryVersion.php +++ b/core/lib/Thelia/Model/Base/CategoryVersion.php @@ -1019,35 +1019,35 @@ abstract class CategoryVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CategoryVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CategoryVersionTableMap::PARENT)) { - $modifiedColumns[':p' . $index++] = '`PARENT`'; + $modifiedColumns[':p' . $index++] = 'PARENT'; } if ($this->isColumnModified(CategoryVersionTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(CategoryVersionTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CategoryVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CategoryVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(CategoryVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(CategoryVersionTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(CategoryVersionTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `category_version` (%s) VALUES (%s)', + 'INSERT INTO category_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1056,31 +1056,31 @@ abstract class CategoryVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PARENT`': + case 'PARENT': $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CategoryVersionQuery.php b/core/lib/Thelia/Model/Base/CategoryVersionQuery.php index a51640003..88c4f460a 100644 --- a/core/lib/Thelia/Model/Base/CategoryVersionQuery.php +++ b/core/lib/Thelia/Model/Base/CategoryVersionQuery.php @@ -159,7 +159,7 @@ abstract class CategoryVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PARENT`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `category_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, PARENT, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM category_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Config.php b/core/lib/Thelia/Model/Base/Config.php index b7ca01d01..72837ec39 100644 --- a/core/lib/Thelia/Model/Base/Config.php +++ b/core/lib/Thelia/Model/Base/Config.php @@ -968,29 +968,29 @@ abstract class Config implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ConfigTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ConfigTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } if ($this->isColumnModified(ConfigTableMap::VALUE)) { - $modifiedColumns[':p' . $index++] = '`VALUE`'; + $modifiedColumns[':p' . $index++] = 'VALUE'; } if ($this->isColumnModified(ConfigTableMap::SECURED)) { - $modifiedColumns[':p' . $index++] = '`SECURED`'; + $modifiedColumns[':p' . $index++] = 'SECURED'; } if ($this->isColumnModified(ConfigTableMap::HIDDEN)) { - $modifiedColumns[':p' . $index++] = '`HIDDEN`'; + $modifiedColumns[':p' . $index++] = 'HIDDEN'; } if ($this->isColumnModified(ConfigTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ConfigTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `config` (%s) VALUES (%s)', + 'INSERT INTO config (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -999,25 +999,25 @@ abstract class Config implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; - case '`VALUE`': + case 'VALUE': $stmt->bindValue($identifier, $this->value, PDO::PARAM_STR); break; - case '`SECURED`': + case 'SECURED': $stmt->bindValue($identifier, $this->secured, PDO::PARAM_INT); break; - case '`HIDDEN`': + case 'HIDDEN': $stmt->bindValue($identifier, $this->hidden, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ConfigI18n.php b/core/lib/Thelia/Model/Base/ConfigI18n.php index d5a976276..370860b61 100644 --- a/core/lib/Thelia/Model/Base/ConfigI18n.php +++ b/core/lib/Thelia/Model/Base/ConfigI18n.php @@ -858,26 +858,26 @@ abstract class ConfigI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ConfigI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ConfigI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ConfigI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ConfigI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ConfigI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ConfigI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `config_i18n` (%s) VALUES (%s)', + 'INSERT INTO config_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ConfigI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ConfigI18nQuery.php b/core/lib/Thelia/Model/Base/ConfigI18nQuery.php index b10bb1da3..bc231b05c 100644 --- a/core/lib/Thelia/Model/Base/ConfigI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ConfigI18nQuery.php @@ -147,7 +147,7 @@ abstract class ConfigI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `config_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM config_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ConfigQuery.php b/core/lib/Thelia/Model/Base/ConfigQuery.php index d219bb4a2..ef47308a4 100644 --- a/core/lib/Thelia/Model/Base/ConfigQuery.php +++ b/core/lib/Thelia/Model/Base/ConfigQuery.php @@ -152,7 +152,7 @@ abstract class ConfigQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `NAME`, `VALUE`, `SECURED`, `HIDDEN`, `CREATED_AT`, `UPDATED_AT` FROM `config` WHERE `ID` = :p0'; + $sql = 'SELECT ID, NAME, VALUE, SECURED, HIDDEN, CREATED_AT, UPDATED_AT FROM config WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Content.php b/core/lib/Thelia/Model/Base/Content.php index 1e6165d3e..6618ae9c7 100644 --- a/core/lib/Thelia/Model/Base/Content.php +++ b/core/lib/Thelia/Model/Base/Content.php @@ -1275,32 +1275,32 @@ abstract class Content implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(ContentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ContentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ContentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(ContentTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(ContentTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(ContentTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `content` (%s) VALUES (%s)', + 'INSERT INTO content (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1309,28 +1309,28 @@ abstract class Content implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ContentDocument.php b/core/lib/Thelia/Model/Base/ContentDocument.php index 382154637..f59b52af0 100644 --- a/core/lib/Thelia/Model/Base/ContentDocument.php +++ b/core/lib/Thelia/Model/Base/ContentDocument.php @@ -930,26 +930,26 @@ abstract class ContentDocument implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentDocumentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentDocumentTableMap::CONTENT_ID)) { - $modifiedColumns[':p' . $index++] = '`CONTENT_ID`'; + $modifiedColumns[':p' . $index++] = 'CONTENT_ID'; } if ($this->isColumnModified(ContentDocumentTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(ContentDocumentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ContentDocumentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ContentDocumentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `content_document` (%s) VALUES (%s)', + 'INSERT INTO content_document (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class ContentDocument implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CONTENT_ID`': + case 'CONTENT_ID': $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ContentDocumentI18n.php b/core/lib/Thelia/Model/Base/ContentDocumentI18n.php index 22139cd78..e51c76524 100644 --- a/core/lib/Thelia/Model/Base/ContentDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/ContentDocumentI18n.php @@ -858,26 +858,26 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentDocumentI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentDocumentI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ContentDocumentI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ContentDocumentI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ContentDocumentI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ContentDocumentI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `content_document_i18n` (%s) VALUES (%s)', + 'INSERT INTO content_document_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ContentDocumentI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php b/core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php index 67ef58154..e88858892 100644 --- a/core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ContentDocumentI18nQuery.php @@ -147,7 +147,7 @@ abstract class ContentDocumentI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `content_document_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_document_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentDocumentQuery.php b/core/lib/Thelia/Model/Base/ContentDocumentQuery.php index f6e09b426..89cf5d48b 100644 --- a/core/lib/Thelia/Model/Base/ContentDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/ContentDocumentQuery.php @@ -152,7 +152,7 @@ abstract class ContentDocumentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CONTENT_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `content_document` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_document WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentFolder.php b/core/lib/Thelia/Model/Base/ContentFolder.php index 2e4525e28..8200b942c 100644 --- a/core/lib/Thelia/Model/Base/ContentFolder.php +++ b/core/lib/Thelia/Model/Base/ContentFolder.php @@ -867,23 +867,23 @@ abstract class ContentFolder implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentFolderTableMap::CONTENT_ID)) { - $modifiedColumns[':p' . $index++] = '`CONTENT_ID`'; + $modifiedColumns[':p' . $index++] = 'CONTENT_ID'; } if ($this->isColumnModified(ContentFolderTableMap::FOLDER_ID)) { - $modifiedColumns[':p' . $index++] = '`FOLDER_ID`'; + $modifiedColumns[':p' . $index++] = 'FOLDER_ID'; } if ($this->isColumnModified(ContentFolderTableMap::DEFAULT_FOLDER)) { - $modifiedColumns[':p' . $index++] = '`DEFAULT_FOLDER`'; + $modifiedColumns[':p' . $index++] = 'DEFAULT_FOLDER'; } if ($this->isColumnModified(ContentFolderTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ContentFolderTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `content_folder` (%s) VALUES (%s)', + 'INSERT INTO content_folder (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -892,19 +892,19 @@ abstract class ContentFolder implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`CONTENT_ID`': + case 'CONTENT_ID': $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT); break; - case '`FOLDER_ID`': + case 'FOLDER_ID': $stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT); break; - case '`DEFAULT_FOLDER`': + case 'DEFAULT_FOLDER': $stmt->bindValue($identifier, (int) $this->default_folder, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ContentFolderQuery.php b/core/lib/Thelia/Model/Base/ContentFolderQuery.php index 4aa4e26df..72561ae77 100644 --- a/core/lib/Thelia/Model/Base/ContentFolderQuery.php +++ b/core/lib/Thelia/Model/Base/ContentFolderQuery.php @@ -147,7 +147,7 @@ abstract class ContentFolderQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `CONTENT_ID`, `FOLDER_ID`, `DEFAULT_FOLDER`, `CREATED_AT`, `UPDATED_AT` FROM `content_folder` WHERE `CONTENT_ID` = :p0 AND `FOLDER_ID` = :p1'; + $sql = 'SELECT CONTENT_ID, FOLDER_ID, DEFAULT_FOLDER, CREATED_AT, UPDATED_AT FROM content_folder WHERE CONTENT_ID = :p0 AND FOLDER_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentI18n.php b/core/lib/Thelia/Model/Base/ContentI18n.php index 706f8a714..5b5dd2459 100644 --- a/core/lib/Thelia/Model/Base/ContentI18n.php +++ b/core/lib/Thelia/Model/Base/ContentI18n.php @@ -981,35 +981,35 @@ abstract class ContentI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ContentI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ContentI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ContentI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ContentI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } if ($this->isColumnModified(ContentI18nTableMap::META_TITLE)) { - $modifiedColumns[':p' . $index++] = '`META_TITLE`'; + $modifiedColumns[':p' . $index++] = 'META_TITLE'; } if ($this->isColumnModified(ContentI18nTableMap::META_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`META_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'META_DESCRIPTION'; } if ($this->isColumnModified(ContentI18nTableMap::META_KEYWORDS)) { - $modifiedColumns[':p' . $index++] = '`META_KEYWORDS`'; + $modifiedColumns[':p' . $index++] = 'META_KEYWORDS'; } $sql = sprintf( - 'INSERT INTO `content_i18n` (%s) VALUES (%s)', + 'INSERT INTO content_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1018,31 +1018,31 @@ abstract class ContentI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; - case '`META_TITLE`': + case 'META_TITLE': $stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR); break; - case '`META_DESCRIPTION`': + case 'META_DESCRIPTION': $stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR); break; - case '`META_KEYWORDS`': + case 'META_KEYWORDS': $stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ContentI18nQuery.php b/core/lib/Thelia/Model/Base/ContentI18nQuery.php index c2b1dc15b..ed844f4c2 100644 --- a/core/lib/Thelia/Model/Base/ContentI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ContentI18nQuery.php @@ -159,7 +159,7 @@ abstract class ContentI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS` FROM `content_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM content_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentImage.php b/core/lib/Thelia/Model/Base/ContentImage.php index 0dd622743..17fa9d1f8 100644 --- a/core/lib/Thelia/Model/Base/ContentImage.php +++ b/core/lib/Thelia/Model/Base/ContentImage.php @@ -930,26 +930,26 @@ abstract class ContentImage implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentImageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentImageTableMap::CONTENT_ID)) { - $modifiedColumns[':p' . $index++] = '`CONTENT_ID`'; + $modifiedColumns[':p' . $index++] = 'CONTENT_ID'; } if ($this->isColumnModified(ContentImageTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(ContentImageTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ContentImageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ContentImageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `content_image` (%s) VALUES (%s)', + 'INSERT INTO content_image (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class ContentImage implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CONTENT_ID`': + case 'CONTENT_ID': $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ContentImageI18n.php b/core/lib/Thelia/Model/Base/ContentImageI18n.php index 996ce8b5c..dcee14315 100644 --- a/core/lib/Thelia/Model/Base/ContentImageI18n.php +++ b/core/lib/Thelia/Model/Base/ContentImageI18n.php @@ -858,26 +858,26 @@ abstract class ContentImageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentImageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentImageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ContentImageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ContentImageI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ContentImageI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ContentImageI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `content_image_i18n` (%s) VALUES (%s)', + 'INSERT INTO content_image_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ContentImageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ContentImageI18nQuery.php b/core/lib/Thelia/Model/Base/ContentImageI18nQuery.php index e99e58f37..1807c5bb7 100644 --- a/core/lib/Thelia/Model/Base/ContentImageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ContentImageI18nQuery.php @@ -147,7 +147,7 @@ abstract class ContentImageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `content_image_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM content_image_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentImageQuery.php b/core/lib/Thelia/Model/Base/ContentImageQuery.php index 339bdfc55..f69464dd7 100644 --- a/core/lib/Thelia/Model/Base/ContentImageQuery.php +++ b/core/lib/Thelia/Model/Base/ContentImageQuery.php @@ -152,7 +152,7 @@ abstract class ContentImageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CONTENT_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `content_image` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CONTENT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM content_image WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentQuery.php b/core/lib/Thelia/Model/Base/ContentQuery.php index 0cbd7191d..0dc2f57a4 100644 --- a/core/lib/Thelia/Model/Base/ContentQuery.php +++ b/core/lib/Thelia/Model/Base/ContentQuery.php @@ -187,7 +187,7 @@ abstract class ContentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `content` WHERE `ID` = :p0'; + $sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM content WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ContentVersion.php b/core/lib/Thelia/Model/Base/ContentVersion.php index f4190b659..beb02456e 100644 --- a/core/lib/Thelia/Model/Base/ContentVersion.php +++ b/core/lib/Thelia/Model/Base/ContentVersion.php @@ -978,32 +978,32 @@ abstract class ContentVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ContentVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ContentVersionTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(ContentVersionTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ContentVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ContentVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(ContentVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(ContentVersionTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(ContentVersionTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `content_version` (%s) VALUES (%s)', + 'INSERT INTO content_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1012,28 +1012,28 @@ abstract class ContentVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ContentVersionQuery.php b/core/lib/Thelia/Model/Base/ContentVersionQuery.php index 6e8481c99..ae737d96e 100644 --- a/core/lib/Thelia/Model/Base/ContentVersionQuery.php +++ b/core/lib/Thelia/Model/Base/ContentVersionQuery.php @@ -155,7 +155,7 @@ abstract class ContentVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `content_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM content_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Country.php b/core/lib/Thelia/Model/Base/Country.php index 288ad7128..299b3e511 100644 --- a/core/lib/Thelia/Model/Base/Country.php +++ b/core/lib/Thelia/Model/Base/Country.php @@ -1151,35 +1151,35 @@ abstract class Country implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CountryTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CountryTableMap::AREA_ID)) { - $modifiedColumns[':p' . $index++] = '`AREA_ID`'; + $modifiedColumns[':p' . $index++] = 'AREA_ID'; } if ($this->isColumnModified(CountryTableMap::ISOCODE)) { - $modifiedColumns[':p' . $index++] = '`ISOCODE`'; + $modifiedColumns[':p' . $index++] = 'ISOCODE'; } if ($this->isColumnModified(CountryTableMap::ISOALPHA2)) { - $modifiedColumns[':p' . $index++] = '`ISOALPHA2`'; + $modifiedColumns[':p' . $index++] = 'ISOALPHA2'; } if ($this->isColumnModified(CountryTableMap::ISOALPHA3)) { - $modifiedColumns[':p' . $index++] = '`ISOALPHA3`'; + $modifiedColumns[':p' . $index++] = 'ISOALPHA3'; } if ($this->isColumnModified(CountryTableMap::BY_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`BY_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'BY_DEFAULT'; } if ($this->isColumnModified(CountryTableMap::SHOP_COUNTRY)) { - $modifiedColumns[':p' . $index++] = '`SHOP_COUNTRY`'; + $modifiedColumns[':p' . $index++] = 'SHOP_COUNTRY'; } if ($this->isColumnModified(CountryTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CountryTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `country` (%s) VALUES (%s)', + 'INSERT INTO country (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1188,31 +1188,31 @@ abstract class Country implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`AREA_ID`': + case 'AREA_ID': $stmt->bindValue($identifier, $this->area_id, PDO::PARAM_INT); break; - case '`ISOCODE`': + case 'ISOCODE': $stmt->bindValue($identifier, $this->isocode, PDO::PARAM_STR); break; - case '`ISOALPHA2`': + case 'ISOALPHA2': $stmt->bindValue($identifier, $this->isoalpha2, PDO::PARAM_STR); break; - case '`ISOALPHA3`': + case 'ISOALPHA3': $stmt->bindValue($identifier, $this->isoalpha3, PDO::PARAM_STR); break; - case '`BY_DEFAULT`': + case 'BY_DEFAULT': $stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT); break; - case '`SHOP_COUNTRY`': + case 'SHOP_COUNTRY': $stmt->bindValue($identifier, (int) $this->shop_country, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CountryI18n.php b/core/lib/Thelia/Model/Base/CountryI18n.php index 16fcf0d0f..2c660e200 100644 --- a/core/lib/Thelia/Model/Base/CountryI18n.php +++ b/core/lib/Thelia/Model/Base/CountryI18n.php @@ -858,26 +858,26 @@ abstract class CountryI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CountryI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CountryI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CountryI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(CountryI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(CountryI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(CountryI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `country_i18n` (%s) VALUES (%s)', + 'INSERT INTO country_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class CountryI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CountryI18nQuery.php b/core/lib/Thelia/Model/Base/CountryI18nQuery.php index 81ea2b508..924ed263a 100644 --- a/core/lib/Thelia/Model/Base/CountryI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CountryI18nQuery.php @@ -147,7 +147,7 @@ abstract class CountryI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `country_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM country_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CountryQuery.php b/core/lib/Thelia/Model/Base/CountryQuery.php index 270802f07..9135e293a 100644 --- a/core/lib/Thelia/Model/Base/CountryQuery.php +++ b/core/lib/Thelia/Model/Base/CountryQuery.php @@ -172,7 +172,7 @@ abstract class CountryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `AREA_ID`, `ISOCODE`, `ISOALPHA2`, `ISOALPHA3`, `BY_DEFAULT`, `SHOP_COUNTRY`, `CREATED_AT`, `UPDATED_AT` FROM `country` WHERE `ID` = :p0'; + $sql = 'SELECT ID, AREA_ID, ISOCODE, ISOALPHA2, ISOALPHA3, BY_DEFAULT, SHOP_COUNTRY, CREATED_AT, UPDATED_AT FROM country WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Coupon.php b/core/lib/Thelia/Model/Base/Coupon.php index e664fc623..012b97313 100644 --- a/core/lib/Thelia/Model/Base/Coupon.php +++ b/core/lib/Thelia/Model/Base/Coupon.php @@ -1393,53 +1393,53 @@ abstract class Coupon implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CouponTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CouponTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(CouponTableMap::TYPE)) { - $modifiedColumns[':p' . $index++] = '`TYPE`'; + $modifiedColumns[':p' . $index++] = 'TYPE'; } if ($this->isColumnModified(CouponTableMap::AMOUNT)) { - $modifiedColumns[':p' . $index++] = '`AMOUNT`'; + $modifiedColumns[':p' . $index++] = 'AMOUNT'; } if ($this->isColumnModified(CouponTableMap::IS_ENABLED)) { - $modifiedColumns[':p' . $index++] = '`IS_ENABLED`'; + $modifiedColumns[':p' . $index++] = 'IS_ENABLED'; } if ($this->isColumnModified(CouponTableMap::EXPIRATION_DATE)) { - $modifiedColumns[':p' . $index++] = '`EXPIRATION_DATE`'; + $modifiedColumns[':p' . $index++] = 'EXPIRATION_DATE'; } if ($this->isColumnModified(CouponTableMap::MAX_USAGE)) { - $modifiedColumns[':p' . $index++] = '`MAX_USAGE`'; + $modifiedColumns[':p' . $index++] = 'MAX_USAGE'; } if ($this->isColumnModified(CouponTableMap::IS_CUMULATIVE)) { - $modifiedColumns[':p' . $index++] = '`IS_CUMULATIVE`'; + $modifiedColumns[':p' . $index++] = 'IS_CUMULATIVE'; } if ($this->isColumnModified(CouponTableMap::IS_REMOVING_POSTAGE)) { - $modifiedColumns[':p' . $index++] = '`IS_REMOVING_POSTAGE`'; + $modifiedColumns[':p' . $index++] = 'IS_REMOVING_POSTAGE'; } if ($this->isColumnModified(CouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS)) { - $modifiedColumns[':p' . $index++] = '`IS_AVAILABLE_ON_SPECIAL_OFFERS`'; + $modifiedColumns[':p' . $index++] = 'IS_AVAILABLE_ON_SPECIAL_OFFERS'; } if ($this->isColumnModified(CouponTableMap::IS_USED)) { - $modifiedColumns[':p' . $index++] = '`IS_USED`'; + $modifiedColumns[':p' . $index++] = 'IS_USED'; } if ($this->isColumnModified(CouponTableMap::SERIALIZED_CONDITIONS)) { - $modifiedColumns[':p' . $index++] = '`SERIALIZED_CONDITIONS`'; + $modifiedColumns[':p' . $index++] = 'SERIALIZED_CONDITIONS'; } if ($this->isColumnModified(CouponTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CouponTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(CouponTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } $sql = sprintf( - 'INSERT INTO `coupon` (%s) VALUES (%s)', + 'INSERT INTO coupon (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1448,49 +1448,49 @@ abstract class Coupon implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); break; - case '`TYPE`': + case 'TYPE': $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR); break; - case '`AMOUNT`': + case 'AMOUNT': $stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR); break; - case '`IS_ENABLED`': + case 'IS_ENABLED': $stmt->bindValue($identifier, (int) $this->is_enabled, PDO::PARAM_INT); break; - case '`EXPIRATION_DATE`': + case 'EXPIRATION_DATE': $stmt->bindValue($identifier, $this->expiration_date ? $this->expiration_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; - case '`MAX_USAGE`': + case 'MAX_USAGE': $stmt->bindValue($identifier, $this->max_usage, PDO::PARAM_INT); break; - case '`IS_CUMULATIVE`': + case 'IS_CUMULATIVE': $stmt->bindValue($identifier, (int) $this->is_cumulative, PDO::PARAM_INT); break; - case '`IS_REMOVING_POSTAGE`': + case 'IS_REMOVING_POSTAGE': $stmt->bindValue($identifier, (int) $this->is_removing_postage, PDO::PARAM_INT); break; - case '`IS_AVAILABLE_ON_SPECIAL_OFFERS`': + case 'IS_AVAILABLE_ON_SPECIAL_OFFERS': $stmt->bindValue($identifier, (int) $this->is_available_on_special_offers, PDO::PARAM_INT); break; - case '`IS_USED`': + case 'IS_USED': $stmt->bindValue($identifier, (int) $this->is_used, PDO::PARAM_INT); break; - case '`SERIALIZED_CONDITIONS`': + case 'SERIALIZED_CONDITIONS': $stmt->bindValue($identifier, $this->serialized_conditions, PDO::PARAM_STR); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); break; } diff --git a/core/lib/Thelia/Model/Base/CouponI18n.php b/core/lib/Thelia/Model/Base/CouponI18n.php index eed23d5fe..7bb7d8314 100644 --- a/core/lib/Thelia/Model/Base/CouponI18n.php +++ b/core/lib/Thelia/Model/Base/CouponI18n.php @@ -817,23 +817,23 @@ abstract class CouponI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CouponI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CouponI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CouponI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(CouponI18nTableMap::SHORT_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`SHORT_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'SHORT_DESCRIPTION'; } if ($this->isColumnModified(CouponI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } $sql = sprintf( - 'INSERT INTO `coupon_i18n` (%s) VALUES (%s)', + 'INSERT INTO coupon_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -842,19 +842,19 @@ abstract class CouponI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`SHORT_DESCRIPTION`': + case 'SHORT_DESCRIPTION': $stmt->bindValue($identifier, $this->short_description, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CouponI18nQuery.php b/core/lib/Thelia/Model/Base/CouponI18nQuery.php index 217796a80..5dfbdbcdc 100644 --- a/core/lib/Thelia/Model/Base/CouponI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CouponI18nQuery.php @@ -143,7 +143,7 @@ abstract class CouponI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `SHORT_DESCRIPTION`, `DESCRIPTION` FROM `coupon_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, SHORT_DESCRIPTION, DESCRIPTION FROM coupon_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderCoupon.php b/core/lib/Thelia/Model/Base/CouponOrder.php similarity index 58% rename from core/lib/Thelia/Model/Base/OrderCoupon.php rename to core/lib/Thelia/Model/Base/CouponOrder.php index 296b1af0a..4488e8ec6 100644 --- a/core/lib/Thelia/Model/Base/OrderCoupon.php +++ b/core/lib/Thelia/Model/Base/CouponOrder.php @@ -16,18 +16,18 @@ use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Map\TableMap; use Propel\Runtime\Parser\AbstractParser; use Propel\Runtime\Util\PropelDateTime; +use Thelia\Model\CouponOrder as ChildCouponOrder; +use Thelia\Model\CouponOrderQuery as ChildCouponOrderQuery; use Thelia\Model\Order as ChildOrder; -use Thelia\Model\OrderCoupon as ChildOrderCoupon; -use Thelia\Model\OrderCouponQuery as ChildOrderCouponQuery; use Thelia\Model\OrderQuery as ChildOrderQuery; -use Thelia\Model\Map\OrderCouponTableMap; +use Thelia\Model\Map\CouponOrderTableMap; -abstract class OrderCoupon implements ActiveRecordInterface +abstract class CouponOrder implements ActiveRecordInterface { /** * TableMap class name */ - const TABLE_MAP = '\\Thelia\\Model\\Map\\OrderCouponTableMap'; + const TABLE_MAP = '\\Thelia\\Model\\Map\\CouponOrderTableMap'; /** @@ -69,70 +69,10 @@ abstract class OrderCoupon implements ActiveRecordInterface protected $order_id; /** - * The value for the code field. - * @var string - */ - protected $code; - - /** - * The value for the type field. - * @var string - */ - protected $type; - - /** - * The value for the amount field. + * The value for the value field. * @var double */ - protected $amount; - - /** - * The value for the title field. - * @var string - */ - protected $title; - - /** - * The value for the short_description field. - * @var string - */ - protected $short_description; - - /** - * The value for the description field. - * @var string - */ - protected $description; - - /** - * The value for the expiration_date field. - * @var string - */ - protected $expiration_date; - - /** - * The value for the is_cumulative field. - * @var boolean - */ - protected $is_cumulative; - - /** - * The value for the is_removing_postage field. - * @var boolean - */ - protected $is_removing_postage; - - /** - * The value for the is_available_on_special_offers field. - * @var boolean - */ - protected $is_available_on_special_offers; - - /** - * The value for the serialized_conditions field. - * @var string - */ - protected $serialized_conditions; + protected $value; /** * The value for the created_at field. @@ -160,7 +100,7 @@ abstract class OrderCoupon implements ActiveRecordInterface protected $alreadyInSave = false; /** - * Initializes internal state of Thelia\Model\Base\OrderCoupon object. + * Initializes internal state of Thelia\Model\Base\CouponOrder object. */ public function __construct() { @@ -255,9 +195,9 @@ abstract class OrderCoupon implements ActiveRecordInterface } /** - * Compares this with another OrderCoupon instance. If - * obj is an instance of OrderCoupon, delegates to - * equals(OrderCoupon). Otherwise, returns false. + * Compares this with another CouponOrder instance. If + * obj is an instance of CouponOrder, delegates to + * equals(CouponOrder). Otherwise, returns false. * * @param mixed $obj The object to compare to. * @return boolean Whether equal to the object specified. @@ -340,7 +280,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * @param string $name The virtual column name * @param mixed $value The value to give to the virtual column * - * @return OrderCoupon The current object, for fluid interface + * @return CouponOrder The current object, for fluid interface */ public function setVirtualColumn($name, $value) { @@ -372,7 +312,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * or a format name ('XML', 'YAML', 'JSON', 'CSV') * @param string $data The source data to import from * - * @return OrderCoupon The current object, for fluid interface + * @return CouponOrder The current object, for fluid interface */ public function importFrom($parser, $data) { @@ -440,133 +380,14 @@ abstract class OrderCoupon implements ActiveRecordInterface } /** - * Get the [code] column value. - * - * @return string - */ - public function getCode() - { - - return $this->code; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - - return $this->type; - } - - /** - * Get the [amount] column value. + * Get the [value] column value. * * @return double */ - public function getAmount() + public function getValue() { - return $this->amount; - } - - /** - * Get the [title] column value. - * - * @return string - */ - public function getTitle() - { - - return $this->title; - } - - /** - * Get the [short_description] column value. - * - * @return string - */ - public function getShortDescription() - { - - return $this->short_description; - } - - /** - * Get the [description] column value. - * - * @return string - */ - public function getDescription() - { - - return $this->description; - } - - /** - * Get the [optionally formatted] temporal [expiration_date] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is NULL, then the raw \DateTime object will be returned. - * - * @return mixed Formatted date/time value as string or \DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00 - * - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getExpirationDate($format = NULL) - { - if ($format === null) { - return $this->expiration_date; - } else { - return $this->expiration_date instanceof \DateTime ? $this->expiration_date->format($format) : null; - } - } - - /** - * Get the [is_cumulative] column value. - * - * @return boolean - */ - public function getIsCumulative() - { - - return $this->is_cumulative; - } - - /** - * Get the [is_removing_postage] column value. - * - * @return boolean - */ - public function getIsRemovingPostage() - { - - return $this->is_removing_postage; - } - - /** - * Get the [is_available_on_special_offers] column value. - * - * @return boolean - */ - public function getIsAvailableOnSpecialOffers() - { - - return $this->is_available_on_special_offers; - } - - /** - * Get the [serialized_conditions] column value. - * - * @return string - */ - public function getSerializedConditions() - { - - return $this->serialized_conditions; + return $this->value; } /** @@ -613,7 +434,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * Set the value of [id] column. * * @param int $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) */ public function setId($v) { @@ -623,7 +444,7 @@ abstract class OrderCoupon implements ActiveRecordInterface if ($this->id !== $v) { $this->id = $v; - $this->modifiedColumns[] = OrderCouponTableMap::ID; + $this->modifiedColumns[] = CouponOrderTableMap::ID; } @@ -634,7 +455,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * Set the value of [order_id] column. * * @param int $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) */ public function setOrderId($v) { @@ -644,7 +465,7 @@ abstract class OrderCoupon implements ActiveRecordInterface if ($this->order_id !== $v) { $this->order_id = $v; - $this->modifiedColumns[] = OrderCouponTableMap::ORDER_ID; + $this->modifiedColumns[] = CouponOrderTableMap::ORDER_ID; } if ($this->aOrder !== null && $this->aOrder->getId() !== $v) { @@ -656,266 +477,32 @@ abstract class OrderCoupon implements ActiveRecordInterface } // setOrderId() /** - * Set the value of [code] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setCode($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->code !== $v) { - $this->code = $v; - $this->modifiedColumns[] = OrderCouponTableMap::CODE; - } - - - return $this; - } // setCode() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = OrderCouponTableMap::TYPE; - } - - - return $this; - } // setType() - - /** - * Set the value of [amount] column. + * Set the value of [value] column. * * @param double $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) */ - public function setAmount($v) + public function setValue($v) { if ($v !== null) { $v = (double) $v; } - if ($this->amount !== $v) { - $this->amount = $v; - $this->modifiedColumns[] = OrderCouponTableMap::AMOUNT; + if ($this->value !== $v) { + $this->value = $v; + $this->modifiedColumns[] = CouponOrderTableMap::VALUE; } return $this; - } // setAmount() - - /** - * Set the value of [title] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->title !== $v) { - $this->title = $v; - $this->modifiedColumns[] = OrderCouponTableMap::TITLE; - } - - - return $this; - } // setTitle() - - /** - * Set the value of [short_description] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setShortDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->short_description !== $v) { - $this->short_description = $v; - $this->modifiedColumns[] = OrderCouponTableMap::SHORT_DESCRIPTION; - } - - - return $this; - } // setShortDescription() - - /** - * Set the value of [description] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->description !== $v) { - $this->description = $v; - $this->modifiedColumns[] = OrderCouponTableMap::DESCRIPTION; - } - - - return $this; - } // setDescription() - - /** - * Sets the value of [expiration_date] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or \DateTime value. - * Empty strings are treated as NULL. - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setExpirationDate($v) - { - $dt = PropelDateTime::newInstance($v, null, '\DateTime'); - if ($this->expiration_date !== null || $dt !== null) { - if ($dt !== $this->expiration_date) { - $this->expiration_date = $dt; - $this->modifiedColumns[] = OrderCouponTableMap::EXPIRATION_DATE; - } - } // if either are not null - - - return $this; - } // setExpirationDate() - - /** - * Sets the value of the [is_cumulative] column. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * - * @param boolean|integer|string $v The new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setIsCumulative($v) - { - if ($v !== null) { - if (is_string($v)) { - $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } else { - $v = (boolean) $v; - } - } - - if ($this->is_cumulative !== $v) { - $this->is_cumulative = $v; - $this->modifiedColumns[] = OrderCouponTableMap::IS_CUMULATIVE; - } - - - return $this; - } // setIsCumulative() - - /** - * Sets the value of the [is_removing_postage] column. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * - * @param boolean|integer|string $v The new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setIsRemovingPostage($v) - { - if ($v !== null) { - if (is_string($v)) { - $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } else { - $v = (boolean) $v; - } - } - - if ($this->is_removing_postage !== $v) { - $this->is_removing_postage = $v; - $this->modifiedColumns[] = OrderCouponTableMap::IS_REMOVING_POSTAGE; - } - - - return $this; - } // setIsRemovingPostage() - - /** - * Sets the value of the [is_available_on_special_offers] column. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * - * @param boolean|integer|string $v The new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setIsAvailableOnSpecialOffers($v) - { - if ($v !== null) { - if (is_string($v)) { - $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } else { - $v = (boolean) $v; - } - } - - if ($this->is_available_on_special_offers !== $v) { - $this->is_available_on_special_offers = $v; - $this->modifiedColumns[] = OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS; - } - - - return $this; - } // setIsAvailableOnSpecialOffers() - - /** - * Set the value of [serialized_conditions] column. - * - * @param string $v new value - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) - */ - public function setSerializedConditions($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->serialized_conditions !== $v) { - $this->serialized_conditions = $v; - $this->modifiedColumns[] = OrderCouponTableMap::SERIALIZED_CONDITIONS; - } - - - return $this; - } // setSerializedConditions() + } // setValue() /** * Sets the value of [created_at] column to a normalized version of the date/time value specified. * * @param mixed $v string, integer (timestamp), or \DateTime value. * Empty strings are treated as NULL. - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) */ public function setCreatedAt($v) { @@ -923,7 +510,7 @@ abstract class OrderCoupon implements ActiveRecordInterface if ($this->created_at !== null || $dt !== null) { if ($dt !== $this->created_at) { $this->created_at = $dt; - $this->modifiedColumns[] = OrderCouponTableMap::CREATED_AT; + $this->modifiedColumns[] = CouponOrderTableMap::CREATED_AT; } } // if either are not null @@ -936,7 +523,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * * @param mixed $v string, integer (timestamp), or \DateTime value. * Empty strings are treated as NULL. - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) */ public function setUpdatedAt($v) { @@ -944,7 +531,7 @@ abstract class OrderCoupon implements ActiveRecordInterface if ($this->updated_at !== null || $dt !== null) { if ($dt !== $this->updated_at) { $this->updated_at = $dt; - $this->modifiedColumns[] = OrderCouponTableMap::UPDATED_AT; + $this->modifiedColumns[] = CouponOrderTableMap::UPDATED_AT; } } // if either are not null @@ -989,55 +576,22 @@ abstract class OrderCoupon implements ActiveRecordInterface try { - $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : OrderCouponTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CouponOrderTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]; $this->id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : OrderCouponTableMap::translateFieldName('OrderId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : CouponOrderTableMap::translateFieldName('OrderId', TableMap::TYPE_PHPNAME, $indexType)]; $this->order_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : OrderCouponTableMap::translateFieldName('Code', TableMap::TYPE_PHPNAME, $indexType)]; - $this->code = (null !== $col) ? (string) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : CouponOrderTableMap::translateFieldName('Value', TableMap::TYPE_PHPNAME, $indexType)]; + $this->value = (null !== $col) ? (double) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : OrderCouponTableMap::translateFieldName('Type', TableMap::TYPE_PHPNAME, $indexType)]; - $this->type = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : OrderCouponTableMap::translateFieldName('Amount', TableMap::TYPE_PHPNAME, $indexType)]; - $this->amount = (null !== $col) ? (double) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : OrderCouponTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)]; - $this->title = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : OrderCouponTableMap::translateFieldName('ShortDescription', TableMap::TYPE_PHPNAME, $indexType)]; - $this->short_description = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : OrderCouponTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)]; - $this->description = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : OrderCouponTableMap::translateFieldName('ExpirationDate', TableMap::TYPE_PHPNAME, $indexType)]; - if ($col === '0000-00-00 00:00:00') { - $col = null; - } - $this->expiration_date = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : OrderCouponTableMap::translateFieldName('IsCumulative', TableMap::TYPE_PHPNAME, $indexType)]; - $this->is_cumulative = (null !== $col) ? (boolean) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderCouponTableMap::translateFieldName('IsRemovingPostage', TableMap::TYPE_PHPNAME, $indexType)]; - $this->is_removing_postage = (null !== $col) ? (boolean) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : OrderCouponTableMap::translateFieldName('IsAvailableOnSpecialOffers', TableMap::TYPE_PHPNAME, $indexType)]; - $this->is_available_on_special_offers = (null !== $col) ? (boolean) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderCouponTableMap::translateFieldName('SerializedConditions', TableMap::TYPE_PHPNAME, $indexType)]; - $this->serialized_conditions = (null !== $col) ? (string) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderCouponTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : CouponOrderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderCouponTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : CouponOrderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -1050,10 +604,10 @@ abstract class OrderCoupon implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 15; // 15 = OrderCouponTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 5; // 5 = CouponOrderTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { - throw new PropelException("Error populating \Thelia\Model\OrderCoupon object", 0, $e); + throw new PropelException("Error populating \Thelia\Model\CouponOrder object", 0, $e); } } @@ -1098,13 +652,13 @@ abstract class OrderCoupon implements ActiveRecordInterface } if ($con === null) { - $con = Propel::getServiceContainer()->getReadConnection(OrderCouponTableMap::DATABASE_NAME); + $con = Propel::getServiceContainer()->getReadConnection(CouponOrderTableMap::DATABASE_NAME); } // We don't need to alter the object instance pool; we're just modifying this instance // already in the pool. - $dataFetcher = ChildOrderCouponQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con); + $dataFetcher = ChildCouponOrderQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con); $row = $dataFetcher->fetch(); $dataFetcher->close(); if (!$row) { @@ -1124,8 +678,8 @@ abstract class OrderCoupon implements ActiveRecordInterface * @param ConnectionInterface $con * @return void * @throws PropelException - * @see OrderCoupon::setDeleted() - * @see OrderCoupon::isDeleted() + * @see CouponOrder::setDeleted() + * @see CouponOrder::isDeleted() */ public function delete(ConnectionInterface $con = null) { @@ -1134,12 +688,12 @@ abstract class OrderCoupon implements ActiveRecordInterface } if ($con === null) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); } $con->beginTransaction(); try { - $deleteQuery = ChildOrderCouponQuery::create() + $deleteQuery = ChildCouponOrderQuery::create() ->filterByPrimaryKey($this->getPrimaryKey()); $ret = $this->preDelete($con); if ($ret) { @@ -1176,7 +730,7 @@ abstract class OrderCoupon implements ActiveRecordInterface } if ($con === null) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); } $con->beginTransaction(); @@ -1186,16 +740,16 @@ abstract class OrderCoupon implements ActiveRecordInterface if ($isInsert) { $ret = $ret && $this->preInsert($con); // timestampable behavior - if (!$this->isColumnModified(OrderCouponTableMap::CREATED_AT)) { + if (!$this->isColumnModified(CouponOrderTableMap::CREATED_AT)) { $this->setCreatedAt(time()); } - if (!$this->isColumnModified(OrderCouponTableMap::UPDATED_AT)) { + if (!$this->isColumnModified(CouponOrderTableMap::UPDATED_AT)) { $this->setUpdatedAt(time()); } } else { $ret = $ret && $this->preUpdate($con); // timestampable behavior - if ($this->isModified() && !$this->isColumnModified(OrderCouponTableMap::UPDATED_AT)) { + if ($this->isModified() && !$this->isColumnModified(CouponOrderTableMap::UPDATED_AT)) { $this->setUpdatedAt(time()); } } @@ -1207,7 +761,7 @@ abstract class OrderCoupon implements ActiveRecordInterface $this->postUpdate($con); } $this->postSave($con); - OrderCouponTableMap::addInstanceToPool($this); + CouponOrderTableMap::addInstanceToPool($this); } else { $affectedRows = 0; } @@ -1280,60 +834,30 @@ abstract class OrderCoupon implements ActiveRecordInterface $modifiedColumns = array(); $index = 0; - $this->modifiedColumns[] = OrderCouponTableMap::ID; + $this->modifiedColumns[] = CouponOrderTableMap::ID; if (null !== $this->id) { - throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrderCouponTableMap::ID . ')'); + throw new PropelException('Cannot insert a value for auto-increment primary key (' . CouponOrderTableMap::ID . ')'); } // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(OrderCouponTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + if ($this->isColumnModified(CouponOrderTableMap::ID)) { + $modifiedColumns[':p' . $index++] = 'ID'; } - if ($this->isColumnModified(OrderCouponTableMap::ORDER_ID)) { - $modifiedColumns[':p' . $index++] = '`ORDER_ID`'; + if ($this->isColumnModified(CouponOrderTableMap::ORDER_ID)) { + $modifiedColumns[':p' . $index++] = 'ORDER_ID'; } - if ($this->isColumnModified(OrderCouponTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + if ($this->isColumnModified(CouponOrderTableMap::VALUE)) { + $modifiedColumns[':p' . $index++] = 'VALUE'; } - if ($this->isColumnModified(OrderCouponTableMap::TYPE)) { - $modifiedColumns[':p' . $index++] = '`TYPE`'; + if ($this->isColumnModified(CouponOrderTableMap::CREATED_AT)) { + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } - if ($this->isColumnModified(OrderCouponTableMap::AMOUNT)) { - $modifiedColumns[':p' . $index++] = '`AMOUNT`'; - } - if ($this->isColumnModified(OrderCouponTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; - } - if ($this->isColumnModified(OrderCouponTableMap::SHORT_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`SHORT_DESCRIPTION`'; - } - if ($this->isColumnModified(OrderCouponTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; - } - if ($this->isColumnModified(OrderCouponTableMap::EXPIRATION_DATE)) { - $modifiedColumns[':p' . $index++] = '`EXPIRATION_DATE`'; - } - if ($this->isColumnModified(OrderCouponTableMap::IS_CUMULATIVE)) { - $modifiedColumns[':p' . $index++] = '`IS_CUMULATIVE`'; - } - if ($this->isColumnModified(OrderCouponTableMap::IS_REMOVING_POSTAGE)) { - $modifiedColumns[':p' . $index++] = '`IS_REMOVING_POSTAGE`'; - } - if ($this->isColumnModified(OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS)) { - $modifiedColumns[':p' . $index++] = '`IS_AVAILABLE_ON_SPECIAL_OFFERS`'; - } - if ($this->isColumnModified(OrderCouponTableMap::SERIALIZED_CONDITIONS)) { - $modifiedColumns[':p' . $index++] = '`SERIALIZED_CONDITIONS`'; - } - if ($this->isColumnModified(OrderCouponTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; - } - if ($this->isColumnModified(OrderCouponTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + if ($this->isColumnModified(CouponOrderTableMap::UPDATED_AT)) { + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_coupon` (%s) VALUES (%s)', + 'INSERT INTO coupon_order (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1342,49 +866,19 @@ abstract class OrderCoupon implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ORDER_ID`': + case 'ORDER_ID': $stmt->bindValue($identifier, $this->order_id, PDO::PARAM_INT); break; - case '`CODE`': - $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); + case 'VALUE': + $stmt->bindValue($identifier, $this->value, PDO::PARAM_STR); break; - case '`TYPE`': - $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR); - break; - case '`AMOUNT`': - $stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR); - break; - case '`TITLE`': - $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); - break; - case '`SHORT_DESCRIPTION`': - $stmt->bindValue($identifier, $this->short_description, PDO::PARAM_STR); - break; - case '`DESCRIPTION`': - $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); - break; - case '`EXPIRATION_DATE`': - $stmt->bindValue($identifier, $this->expiration_date ? $this->expiration_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); - break; - case '`IS_CUMULATIVE`': - $stmt->bindValue($identifier, (int) $this->is_cumulative, PDO::PARAM_INT); - break; - case '`IS_REMOVING_POSTAGE`': - $stmt->bindValue($identifier, (int) $this->is_removing_postage, PDO::PARAM_INT); - break; - case '`IS_AVAILABLE_ON_SPECIAL_OFFERS`': - $stmt->bindValue($identifier, (int) $this->is_available_on_special_offers, PDO::PARAM_INT); - break; - case '`SERIALIZED_CONDITIONS`': - $stmt->bindValue($identifier, $this->serialized_conditions, PDO::PARAM_STR); - 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); 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); break; } @@ -1433,7 +927,7 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function getByName($name, $type = TableMap::TYPE_PHPNAME) { - $pos = OrderCouponTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM); + $pos = CouponOrderTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM); $field = $this->getByPosition($pos); return $field; @@ -1456,42 +950,12 @@ abstract class OrderCoupon implements ActiveRecordInterface return $this->getOrderId(); break; case 2: - return $this->getCode(); + return $this->getValue(); break; case 3: - return $this->getType(); - break; - case 4: - return $this->getAmount(); - break; - case 5: - return $this->getTitle(); - break; - case 6: - return $this->getShortDescription(); - break; - case 7: - return $this->getDescription(); - break; - case 8: - return $this->getExpirationDate(); - break; - case 9: - return $this->getIsCumulative(); - break; - case 10: - return $this->getIsRemovingPostage(); - break; - case 11: - return $this->getIsAvailableOnSpecialOffers(); - break; - case 12: - return $this->getSerializedConditions(); - break; - case 13: return $this->getCreatedAt(); break; - case 14: + case 4: return $this->getUpdatedAt(); break; default: @@ -1517,27 +981,17 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { - if (isset($alreadyDumpedObjects['OrderCoupon'][$this->getPrimaryKey()])) { + if (isset($alreadyDumpedObjects['CouponOrder'][$this->getPrimaryKey()])) { return '*RECURSION*'; } - $alreadyDumpedObjects['OrderCoupon'][$this->getPrimaryKey()] = true; - $keys = OrderCouponTableMap::getFieldNames($keyType); + $alreadyDumpedObjects['CouponOrder'][$this->getPrimaryKey()] = true; + $keys = CouponOrderTableMap::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), $keys[1] => $this->getOrderId(), - $keys[2] => $this->getCode(), - $keys[3] => $this->getType(), - $keys[4] => $this->getAmount(), - $keys[5] => $this->getTitle(), - $keys[6] => $this->getShortDescription(), - $keys[7] => $this->getDescription(), - $keys[8] => $this->getExpirationDate(), - $keys[9] => $this->getIsCumulative(), - $keys[10] => $this->getIsRemovingPostage(), - $keys[11] => $this->getIsAvailableOnSpecialOffers(), - $keys[12] => $this->getSerializedConditions(), - $keys[13] => $this->getCreatedAt(), - $keys[14] => $this->getUpdatedAt(), + $keys[2] => $this->getValue(), + $keys[3] => $this->getCreatedAt(), + $keys[4] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1566,7 +1020,7 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME) { - $pos = OrderCouponTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM); + $pos = CouponOrderTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM); return $this->setByPosition($pos, $value); } @@ -1589,42 +1043,12 @@ abstract class OrderCoupon implements ActiveRecordInterface $this->setOrderId($value); break; case 2: - $this->setCode($value); + $this->setValue($value); break; case 3: - $this->setType($value); - break; - case 4: - $this->setAmount($value); - break; - case 5: - $this->setTitle($value); - break; - case 6: - $this->setShortDescription($value); - break; - case 7: - $this->setDescription($value); - break; - case 8: - $this->setExpirationDate($value); - break; - case 9: - $this->setIsCumulative($value); - break; - case 10: - $this->setIsRemovingPostage($value); - break; - case 11: - $this->setIsAvailableOnSpecialOffers($value); - break; - case 12: - $this->setSerializedConditions($value); - break; - case 13: $this->setCreatedAt($value); break; - case 14: + case 4: $this->setUpdatedAt($value); break; } // switch() @@ -1649,23 +1073,13 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME) { - $keys = OrderCouponTableMap::getFieldNames($keyType); + $keys = CouponOrderTableMap::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setOrderId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setCode($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setType($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setAmount($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setTitle($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setShortDescription($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDescription($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setExpirationDate($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setIsCumulative($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setIsRemovingPostage($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setIsAvailableOnSpecialOffers($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setSerializedConditions($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setCreatedAt($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setUpdatedAt($arr[$keys[14]]); + if (array_key_exists($keys[2], $arr)) $this->setValue($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setUpdatedAt($arr[$keys[4]]); } /** @@ -1675,23 +1089,13 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function buildCriteria() { - $criteria = new Criteria(OrderCouponTableMap::DATABASE_NAME); + $criteria = new Criteria(CouponOrderTableMap::DATABASE_NAME); - if ($this->isColumnModified(OrderCouponTableMap::ID)) $criteria->add(OrderCouponTableMap::ID, $this->id); - if ($this->isColumnModified(OrderCouponTableMap::ORDER_ID)) $criteria->add(OrderCouponTableMap::ORDER_ID, $this->order_id); - if ($this->isColumnModified(OrderCouponTableMap::CODE)) $criteria->add(OrderCouponTableMap::CODE, $this->code); - if ($this->isColumnModified(OrderCouponTableMap::TYPE)) $criteria->add(OrderCouponTableMap::TYPE, $this->type); - if ($this->isColumnModified(OrderCouponTableMap::AMOUNT)) $criteria->add(OrderCouponTableMap::AMOUNT, $this->amount); - if ($this->isColumnModified(OrderCouponTableMap::TITLE)) $criteria->add(OrderCouponTableMap::TITLE, $this->title); - if ($this->isColumnModified(OrderCouponTableMap::SHORT_DESCRIPTION)) $criteria->add(OrderCouponTableMap::SHORT_DESCRIPTION, $this->short_description); - if ($this->isColumnModified(OrderCouponTableMap::DESCRIPTION)) $criteria->add(OrderCouponTableMap::DESCRIPTION, $this->description); - if ($this->isColumnModified(OrderCouponTableMap::EXPIRATION_DATE)) $criteria->add(OrderCouponTableMap::EXPIRATION_DATE, $this->expiration_date); - if ($this->isColumnModified(OrderCouponTableMap::IS_CUMULATIVE)) $criteria->add(OrderCouponTableMap::IS_CUMULATIVE, $this->is_cumulative); - if ($this->isColumnModified(OrderCouponTableMap::IS_REMOVING_POSTAGE)) $criteria->add(OrderCouponTableMap::IS_REMOVING_POSTAGE, $this->is_removing_postage); - if ($this->isColumnModified(OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS)) $criteria->add(OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS, $this->is_available_on_special_offers); - if ($this->isColumnModified(OrderCouponTableMap::SERIALIZED_CONDITIONS)) $criteria->add(OrderCouponTableMap::SERIALIZED_CONDITIONS, $this->serialized_conditions); - if ($this->isColumnModified(OrderCouponTableMap::CREATED_AT)) $criteria->add(OrderCouponTableMap::CREATED_AT, $this->created_at); - if ($this->isColumnModified(OrderCouponTableMap::UPDATED_AT)) $criteria->add(OrderCouponTableMap::UPDATED_AT, $this->updated_at); + if ($this->isColumnModified(CouponOrderTableMap::ID)) $criteria->add(CouponOrderTableMap::ID, $this->id); + if ($this->isColumnModified(CouponOrderTableMap::ORDER_ID)) $criteria->add(CouponOrderTableMap::ORDER_ID, $this->order_id); + if ($this->isColumnModified(CouponOrderTableMap::VALUE)) $criteria->add(CouponOrderTableMap::VALUE, $this->value); + if ($this->isColumnModified(CouponOrderTableMap::CREATED_AT)) $criteria->add(CouponOrderTableMap::CREATED_AT, $this->created_at); + if ($this->isColumnModified(CouponOrderTableMap::UPDATED_AT)) $criteria->add(CouponOrderTableMap::UPDATED_AT, $this->updated_at); return $criteria; } @@ -1706,8 +1110,8 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function buildPkeyCriteria() { - $criteria = new Criteria(OrderCouponTableMap::DATABASE_NAME); - $criteria->add(OrderCouponTableMap::ID, $this->id); + $criteria = new Criteria(CouponOrderTableMap::DATABASE_NAME); + $criteria->add(CouponOrderTableMap::ID, $this->id); return $criteria; } @@ -1748,7 +1152,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * If desired, this method can also make copies of all associated (fkey referrers) * objects. * - * @param object $copyObj An object of \Thelia\Model\OrderCoupon (or compatible) type. + * @param object $copyObj An object of \Thelia\Model\CouponOrder (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @throws PropelException @@ -1756,17 +1160,7 @@ abstract class OrderCoupon implements ActiveRecordInterface public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setOrderId($this->getOrderId()); - $copyObj->setCode($this->getCode()); - $copyObj->setType($this->getType()); - $copyObj->setAmount($this->getAmount()); - $copyObj->setTitle($this->getTitle()); - $copyObj->setShortDescription($this->getShortDescription()); - $copyObj->setDescription($this->getDescription()); - $copyObj->setExpirationDate($this->getExpirationDate()); - $copyObj->setIsCumulative($this->getIsCumulative()); - $copyObj->setIsRemovingPostage($this->getIsRemovingPostage()); - $copyObj->setIsAvailableOnSpecialOffers($this->getIsAvailableOnSpecialOffers()); - $copyObj->setSerializedConditions($this->getSerializedConditions()); + $copyObj->setValue($this->getValue()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($makeNew) { @@ -1784,7 +1178,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * objects. * * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return \Thelia\Model\OrderCoupon Clone of current object. + * @return \Thelia\Model\CouponOrder Clone of current object. * @throws PropelException */ public function copy($deepCopy = false) @@ -1801,7 +1195,7 @@ abstract class OrderCoupon implements ActiveRecordInterface * Declares an association between this object and a ChildOrder object. * * @param ChildOrder $v - * @return \Thelia\Model\OrderCoupon The current object (for fluent API support) + * @return \Thelia\Model\CouponOrder The current object (for fluent API support) * @throws PropelException */ public function setOrder(ChildOrder $v = null) @@ -1817,7 +1211,7 @@ abstract class OrderCoupon implements ActiveRecordInterface // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildOrder object, it will not be re-added. if ($v !== null) { - $v->addOrderCoupon($this); + $v->addCouponOrder($this); } @@ -1841,7 +1235,7 @@ abstract class OrderCoupon implements ActiveRecordInterface to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. - $this->aOrder->addOrderCoupons($this); + $this->aOrder->addCouponOrders($this); */ } @@ -1855,17 +1249,7 @@ abstract class OrderCoupon implements ActiveRecordInterface { $this->id = null; $this->order_id = null; - $this->code = null; - $this->type = null; - $this->amount = null; - $this->title = null; - $this->short_description = null; - $this->description = null; - $this->expiration_date = null; - $this->is_cumulative = null; - $this->is_removing_postage = null; - $this->is_available_on_special_offers = null; - $this->serialized_conditions = null; + $this->value = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; @@ -1899,7 +1283,7 @@ abstract class OrderCoupon implements ActiveRecordInterface */ public function __toString() { - return (string) $this->exportTo(OrderCouponTableMap::DEFAULT_STRING_FORMAT); + return (string) $this->exportTo(CouponOrderTableMap::DEFAULT_STRING_FORMAT); } // timestampable behavior @@ -1907,11 +1291,11 @@ abstract class OrderCoupon implements ActiveRecordInterface /** * Mark the current object so that the update date doesn't get updated during next save * - * @return ChildOrderCoupon The current object (for fluent API support) + * @return ChildCouponOrder The current object (for fluent API support) */ public function keepUpdateDateUnchanged() { - $this->modifiedColumns[] = OrderCouponTableMap::UPDATED_AT; + $this->modifiedColumns[] = CouponOrderTableMap::UPDATED_AT; return $this; } diff --git a/core/lib/Thelia/Model/Base/CouponOrderQuery.php b/core/lib/Thelia/Model/Base/CouponOrderQuery.php new file mode 100644 index 000000000..255d69504 --- /dev/null +++ b/core/lib/Thelia/Model/Base/CouponOrderQuery.php @@ -0,0 +1,678 @@ +setModelAlias($modelAlias); + } + if ($criteria instanceof Criteria) { + $query->mergeWith($criteria); + } + + return $query; + } + + /** + * Find object by primary key. + * Propel uses the instance pool to skip the database if the object exists. + * Go fast if the query is untouched. + * + * + * $obj = $c->findPk(12, $con); + * + * + * @param mixed $key Primary key to use for the query + * @param ConnectionInterface $con an optional connection object + * + * @return ChildCouponOrder|array|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ($key === null) { + return null; + } + if ((null !== ($obj = CouponOrderTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) { + // the object is already in the instance pool + return $obj; + } + if ($con === null) { + $con = Propel::getServiceContainer()->getReadConnection(CouponOrderTableMap::DATABASE_NAME); + } + $this->basePreSelect($con); + if ($this->formatter || $this->modelAlias || $this->with || $this->select + || $this->selectColumns || $this->asColumns || $this->selectModifiers + || $this->map || $this->having || $this->joins) { + return $this->findPkComplex($key, $con); + } else { + return $this->findPkSimple($key, $con); + } + } + + /** + * Find object by primary key using raw SQL to go fast. + * Bypass doSelect() and the object formatter by using generated code. + * + * @param mixed $key Primary key to use for the query + * @param ConnectionInterface $con A connection object + * + * @return ChildCouponOrder A model object, or null if the key is not found + */ + protected function findPkSimple($key, $con) + { + $sql = 'SELECT ID, ORDER_ID, VALUE, CREATED_AT, UPDATED_AT FROM coupon_order WHERE ID = :p0'; + try { + $stmt = $con->prepare($sql); + $stmt->bindValue(':p0', $key, PDO::PARAM_INT); + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); + } + $obj = null; + if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { + $obj = new ChildCouponOrder(); + $obj->hydrate($row); + CouponOrderTableMap::addInstanceToPool($obj, (string) $key); + } + $stmt->closeCursor(); + + return $obj; + } + + /** + * Find object by primary key. + * + * @param mixed $key Primary key to use for the query + * @param ConnectionInterface $con A connection object + * + * @return ChildCouponOrder|array|mixed the result, formatted by the current formatter + */ + protected function findPkComplex($key, $con) + { + // As the query uses a PK condition, no limit(1) is necessary. + $criteria = $this->isKeepQuery() ? clone $this : $this; + $dataFetcher = $criteria + ->filterByPrimaryKey($key) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher); + } + + /** + * Find objects by primary key + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @param array $keys Primary keys to use for the query + * @param ConnectionInterface $con an optional connection object + * + * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter + */ + public function findPks($keys, $con = null) + { + if (null === $con) { + $con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); + } + $this->basePreSelect($con); + $criteria = $this->isKeepQuery() ? clone $this : $this; + $dataFetcher = $criteria + ->filterByPrimaryKeys($keys) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->format($dataFetcher); + } + + /** + * Filter the query by primary key + * + * @param mixed $key Primary key to use for the query + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + + return $this->addUsingAlias(CouponOrderTableMap::ID, $key, Criteria::EQUAL); + } + + /** + * Filter the query by a list of primary keys + * + * @param array $keys The list of primary key to use for the query + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + + return $this->addUsingAlias(CouponOrderTableMap::ID, $keys, Criteria::IN); + } + + /** + * Filter the query on the id column + * + * Example usage: + * + * $query->filterById(1234); // WHERE id = 1234 + * $query->filterById(array(12, 34)); // WHERE id IN (12, 34) + * $query->filterById(array('min' => 12)); // WHERE id > 12 + * + * + * @param mixed $id The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterById($id = null, $comparison = null) + { + if (is_array($id)) { + $useMinMax = false; + if (isset($id['min'])) { + $this->addUsingAlias(CouponOrderTableMap::ID, $id['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($id['max'])) { + $this->addUsingAlias(CouponOrderTableMap::ID, $id['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CouponOrderTableMap::ID, $id, $comparison); + } + + /** + * Filter the query on the order_id column + * + * Example usage: + * + * $query->filterByOrderId(1234); // WHERE order_id = 1234 + * $query->filterByOrderId(array(12, 34)); // WHERE order_id IN (12, 34) + * $query->filterByOrderId(array('min' => 12)); // WHERE order_id > 12 + * + * + * @see filterByOrder() + * + * @param mixed $orderId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByOrderId($orderId = null, $comparison = null) + { + if (is_array($orderId)) { + $useMinMax = false; + if (isset($orderId['min'])) { + $this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($orderId['max'])) { + $this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CouponOrderTableMap::ORDER_ID, $orderId, $comparison); + } + + /** + * Filter the query on the value column + * + * Example usage: + * + * $query->filterByValue(1234); // WHERE value = 1234 + * $query->filterByValue(array(12, 34)); // WHERE value IN (12, 34) + * $query->filterByValue(array('min' => 12)); // WHERE value > 12 + * + * + * @param mixed $value The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByValue($value = null, $comparison = null) + { + if (is_array($value)) { + $useMinMax = false; + if (isset($value['min'])) { + $this->addUsingAlias(CouponOrderTableMap::VALUE, $value['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($value['max'])) { + $this->addUsingAlias(CouponOrderTableMap::VALUE, $value['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CouponOrderTableMap::VALUE, $value, $comparison); + } + + /** + * Filter the query on the created_at column + * + * Example usage: + * + * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' + * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' + * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13' + * + * + * @param mixed $createdAt The value to use as filter. + * Values can be integers (unix timestamps), DateTime objects, or strings. + * Empty strings are treated as NULL. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByCreatedAt($createdAt = null, $comparison = null) + { + if (is_array($createdAt)) { + $useMinMax = false; + if (isset($createdAt['min'])) { + $this->addUsingAlias(CouponOrderTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($createdAt['max'])) { + $this->addUsingAlias(CouponOrderTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CouponOrderTableMap::CREATED_AT, $createdAt, $comparison); + } + + /** + * Filter the query on the updated_at column + * + * Example usage: + * + * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' + * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' + * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13' + * + * + * @param mixed $updatedAt The value to use as filter. + * Values can be integers (unix timestamps), DateTime objects, or strings. + * Empty strings are treated as NULL. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByUpdatedAt($updatedAt = null, $comparison = null) + { + if (is_array($updatedAt)) { + $useMinMax = false; + if (isset($updatedAt['min'])) { + $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($updatedAt['max'])) { + $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, $updatedAt, $comparison); + } + + /** + * Filter the query by a related \Thelia\Model\Order object + * + * @param \Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function filterByOrder($order, $comparison = null) + { + if ($order instanceof \Thelia\Model\Order) { + return $this + ->addUsingAlias(CouponOrderTableMap::ORDER_ID, $order->getId(), $comparison); + } elseif ($order instanceof ObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(CouponOrderTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison); + } else { + throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection'); + } + } + + /** + * Adds a JOIN clause to the query using the Order relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('Order'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'Order'); + } + + return $this; + } + + /** + * Use the Order relation Order object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query + */ + public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinOrder($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery'); + } + + /** + * Exclude object from result + * + * @param ChildCouponOrder $couponOrder Object to remove from the list of results + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function prune($couponOrder = null) + { + if ($couponOrder) { + $this->addUsingAlias(CouponOrderTableMap::ID, $couponOrder->getId(), Criteria::NOT_EQUAL); + } + + return $this; + } + + /** + * Deletes all rows from the coupon_order table. + * + * @param ConnectionInterface $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). + */ + public function doDeleteAll(ConnectionInterface $con = null) + { + if (null === $con) { + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); + } + $affectedRows = 0; // initialize var to track total num of affected rows + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + $affectedRows += parent::doDeleteAll($con); + // Because this db requires some delete cascade/set null emulation, we have to + // clear the cached instance *after* the emulation has happened (since + // instances get re-added by the select statement contained therein). + CouponOrderTableMap::clearInstancePool(); + CouponOrderTableMap::clearRelatedInstancePool(); + + $con->commit(); + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + + return $affectedRows; + } + + /** + * Performs a DELETE on the database, given a ChildCouponOrder or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or ChildCouponOrder object or primary key or array of primary keys + * which is used to create the DELETE statement + * @param ConnectionInterface $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows + * if supported by native driver or if emulated using Propel. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public function delete(ConnectionInterface $con = null) + { + if (null === $con) { + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); + } + + $criteria = $this; + + // Set the correct dbName + $criteria->setDbName(CouponOrderTableMap::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + + + CouponOrderTableMap::removeInstanceFromPool($criteria); + + $affectedRows += ModelCriteria::delete($con); + CouponOrderTableMap::clearRelatedInstancePool(); + $con->commit(); + + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + // timestampable behavior + + /** + * Filter by the latest updated + * + * @param int $nbDays Maximum age of the latest update in days + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function recentlyUpdated($nbDays = 7) + { + return $this->addUsingAlias(CouponOrderTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); + } + + /** + * Filter by the latest created + * + * @param int $nbDays Maximum age of in days + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function recentlyCreated($nbDays = 7) + { + return $this->addUsingAlias(CouponOrderTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); + } + + /** + * Order by update date desc + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function lastUpdatedFirst() + { + return $this->addDescendingOrderByColumn(CouponOrderTableMap::UPDATED_AT); + } + + /** + * Order by update date asc + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function firstUpdatedFirst() + { + return $this->addAscendingOrderByColumn(CouponOrderTableMap::UPDATED_AT); + } + + /** + * Order by create date desc + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function lastCreatedFirst() + { + return $this->addDescendingOrderByColumn(CouponOrderTableMap::CREATED_AT); + } + + /** + * Order by create date asc + * + * @return ChildCouponOrderQuery The current query, for fluid interface + */ + public function firstCreatedFirst() + { + return $this->addAscendingOrderByColumn(CouponOrderTableMap::CREATED_AT); + } + +} // CouponOrderQuery diff --git a/core/lib/Thelia/Model/Base/CouponQuery.php b/core/lib/Thelia/Model/Base/CouponQuery.php index 471fc296b..d480f06c4 100644 --- a/core/lib/Thelia/Model/Base/CouponQuery.php +++ b/core/lib/Thelia/Model/Base/CouponQuery.php @@ -195,7 +195,7 @@ abstract class CouponQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `TYPE`, `AMOUNT`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `CREATED_AT`, `UPDATED_AT`, `VERSION` FROM `coupon` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, TYPE, AMOUNT, IS_ENABLED, EXPIRATION_DATE, MAX_USAGE, IS_CUMULATIVE, IS_REMOVING_POSTAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, IS_USED, SERIALIZED_CONDITIONS, CREATED_AT, UPDATED_AT, VERSION FROM coupon WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CouponVersion.php b/core/lib/Thelia/Model/Base/CouponVersion.php index 687acabdb..67c077cfa 100644 --- a/core/lib/Thelia/Model/Base/CouponVersion.php +++ b/core/lib/Thelia/Model/Base/CouponVersion.php @@ -1305,53 +1305,53 @@ abstract class CouponVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CouponVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CouponVersionTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(CouponVersionTableMap::TYPE)) { - $modifiedColumns[':p' . $index++] = '`TYPE`'; + $modifiedColumns[':p' . $index++] = 'TYPE'; } if ($this->isColumnModified(CouponVersionTableMap::AMOUNT)) { - $modifiedColumns[':p' . $index++] = '`AMOUNT`'; + $modifiedColumns[':p' . $index++] = 'AMOUNT'; } if ($this->isColumnModified(CouponVersionTableMap::IS_ENABLED)) { - $modifiedColumns[':p' . $index++] = '`IS_ENABLED`'; + $modifiedColumns[':p' . $index++] = 'IS_ENABLED'; } if ($this->isColumnModified(CouponVersionTableMap::EXPIRATION_DATE)) { - $modifiedColumns[':p' . $index++] = '`EXPIRATION_DATE`'; + $modifiedColumns[':p' . $index++] = 'EXPIRATION_DATE'; } if ($this->isColumnModified(CouponVersionTableMap::MAX_USAGE)) { - $modifiedColumns[':p' . $index++] = '`MAX_USAGE`'; + $modifiedColumns[':p' . $index++] = 'MAX_USAGE'; } if ($this->isColumnModified(CouponVersionTableMap::IS_CUMULATIVE)) { - $modifiedColumns[':p' . $index++] = '`IS_CUMULATIVE`'; + $modifiedColumns[':p' . $index++] = 'IS_CUMULATIVE'; } if ($this->isColumnModified(CouponVersionTableMap::IS_REMOVING_POSTAGE)) { - $modifiedColumns[':p' . $index++] = '`IS_REMOVING_POSTAGE`'; + $modifiedColumns[':p' . $index++] = 'IS_REMOVING_POSTAGE'; } if ($this->isColumnModified(CouponVersionTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS)) { - $modifiedColumns[':p' . $index++] = '`IS_AVAILABLE_ON_SPECIAL_OFFERS`'; + $modifiedColumns[':p' . $index++] = 'IS_AVAILABLE_ON_SPECIAL_OFFERS'; } if ($this->isColumnModified(CouponVersionTableMap::IS_USED)) { - $modifiedColumns[':p' . $index++] = '`IS_USED`'; + $modifiedColumns[':p' . $index++] = 'IS_USED'; } if ($this->isColumnModified(CouponVersionTableMap::SERIALIZED_CONDITIONS)) { - $modifiedColumns[':p' . $index++] = '`SERIALIZED_CONDITIONS`'; + $modifiedColumns[':p' . $index++] = 'SERIALIZED_CONDITIONS'; } if ($this->isColumnModified(CouponVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CouponVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(CouponVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } $sql = sprintf( - 'INSERT INTO `coupon_version` (%s) VALUES (%s)', + 'INSERT INTO coupon_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1360,49 +1360,49 @@ abstract class CouponVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); break; - case '`TYPE`': + case 'TYPE': $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR); break; - case '`AMOUNT`': + case 'AMOUNT': $stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR); break; - case '`IS_ENABLED`': + case 'IS_ENABLED': $stmt->bindValue($identifier, (int) $this->is_enabled, PDO::PARAM_INT); break; - case '`EXPIRATION_DATE`': + case 'EXPIRATION_DATE': $stmt->bindValue($identifier, $this->expiration_date ? $this->expiration_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; - case '`MAX_USAGE`': + case 'MAX_USAGE': $stmt->bindValue($identifier, $this->max_usage, PDO::PARAM_INT); break; - case '`IS_CUMULATIVE`': + case 'IS_CUMULATIVE': $stmt->bindValue($identifier, (int) $this->is_cumulative, PDO::PARAM_INT); break; - case '`IS_REMOVING_POSTAGE`': + case 'IS_REMOVING_POSTAGE': $stmt->bindValue($identifier, (int) $this->is_removing_postage, PDO::PARAM_INT); break; - case '`IS_AVAILABLE_ON_SPECIAL_OFFERS`': + case 'IS_AVAILABLE_ON_SPECIAL_OFFERS': $stmt->bindValue($identifier, (int) $this->is_available_on_special_offers, PDO::PARAM_INT); break; - case '`IS_USED`': + case 'IS_USED': $stmt->bindValue($identifier, (int) $this->is_used, PDO::PARAM_INT); break; - case '`SERIALIZED_CONDITIONS`': + case 'SERIALIZED_CONDITIONS': $stmt->bindValue($identifier, $this->serialized_conditions, PDO::PARAM_STR); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); break; } diff --git a/core/lib/Thelia/Model/Base/CouponVersionQuery.php b/core/lib/Thelia/Model/Base/CouponVersionQuery.php index 7ff88c828..eebd85dd9 100644 --- a/core/lib/Thelia/Model/Base/CouponVersionQuery.php +++ b/core/lib/Thelia/Model/Base/CouponVersionQuery.php @@ -183,7 +183,7 @@ abstract class CouponVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `TYPE`, `AMOUNT`, `IS_ENABLED`, `EXPIRATION_DATE`, `MAX_USAGE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `IS_USED`, `SERIALIZED_CONDITIONS`, `CREATED_AT`, `UPDATED_AT`, `VERSION` FROM `coupon_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, CODE, TYPE, AMOUNT, IS_ENABLED, EXPIRATION_DATE, MAX_USAGE, IS_CUMULATIVE, IS_REMOVING_POSTAGE, IS_AVAILABLE_ON_SPECIAL_OFFERS, IS_USED, SERIALIZED_CONDITIONS, CREATED_AT, UPDATED_AT, VERSION FROM coupon_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Currency.php b/core/lib/Thelia/Model/Base/Currency.php index d701d0e91..2161e4425 100644 --- a/core/lib/Thelia/Model/Base/Currency.php +++ b/core/lib/Thelia/Model/Base/Currency.php @@ -1084,32 +1084,32 @@ abstract class Currency implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CurrencyTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CurrencyTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(CurrencyTableMap::SYMBOL)) { - $modifiedColumns[':p' . $index++] = '`SYMBOL`'; + $modifiedColumns[':p' . $index++] = 'SYMBOL'; } if ($this->isColumnModified(CurrencyTableMap::RATE)) { - $modifiedColumns[':p' . $index++] = '`RATE`'; + $modifiedColumns[':p' . $index++] = 'RATE'; } if ($this->isColumnModified(CurrencyTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CurrencyTableMap::BY_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`BY_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'BY_DEFAULT'; } if ($this->isColumnModified(CurrencyTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CurrencyTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `currency` (%s) VALUES (%s)', + 'INSERT INTO currency (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1118,28 +1118,28 @@ abstract class Currency implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); break; - case '`SYMBOL`': + case 'SYMBOL': $stmt->bindValue($identifier, $this->symbol, PDO::PARAM_STR); break; - case '`RATE`': + case 'RATE': $stmt->bindValue($identifier, $this->rate, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`BY_DEFAULT`': + case 'BY_DEFAULT': $stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CurrencyI18n.php b/core/lib/Thelia/Model/Base/CurrencyI18n.php index 671696db9..c3e6af289 100644 --- a/core/lib/Thelia/Model/Base/CurrencyI18n.php +++ b/core/lib/Thelia/Model/Base/CurrencyI18n.php @@ -735,17 +735,17 @@ abstract class CurrencyI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CurrencyI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CurrencyI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CurrencyI18nTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } $sql = sprintf( - 'INSERT INTO `currency_i18n` (%s) VALUES (%s)', + 'INSERT INTO currency_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -754,13 +754,13 @@ abstract class CurrencyI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php b/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php index 65019d642..33af4ff87 100644 --- a/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CurrencyI18nQuery.php @@ -135,7 +135,7 @@ abstract class CurrencyI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `NAME` FROM `currency_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, NAME FROM currency_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CurrencyQuery.php b/core/lib/Thelia/Model/Base/CurrencyQuery.php index c6382efba..4276000a1 100644 --- a/core/lib/Thelia/Model/Base/CurrencyQuery.php +++ b/core/lib/Thelia/Model/Base/CurrencyQuery.php @@ -168,7 +168,7 @@ abstract class CurrencyQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `SYMBOL`, `RATE`, `POSITION`, `BY_DEFAULT`, `CREATED_AT`, `UPDATED_AT` FROM `currency` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, SYMBOL, RATE, POSITION, BY_DEFAULT, CREATED_AT, UPDATED_AT FROM currency WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Customer.php b/core/lib/Thelia/Model/Base/Customer.php index 1273b9c02..857dc5e17 100644 --- a/core/lib/Thelia/Model/Base/Customer.php +++ b/core/lib/Thelia/Model/Base/Customer.php @@ -1392,56 +1392,56 @@ abstract class Customer implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CustomerTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CustomerTableMap::REF)) { - $modifiedColumns[':p' . $index++] = '`REF`'; + $modifiedColumns[':p' . $index++] = 'REF'; } if ($this->isColumnModified(CustomerTableMap::TITLE_ID)) { - $modifiedColumns[':p' . $index++] = '`TITLE_ID`'; + $modifiedColumns[':p' . $index++] = 'TITLE_ID'; } if ($this->isColumnModified(CustomerTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; } if ($this->isColumnModified(CustomerTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'LASTNAME'; } if ($this->isColumnModified(CustomerTableMap::EMAIL)) { - $modifiedColumns[':p' . $index++] = '`EMAIL`'; + $modifiedColumns[':p' . $index++] = 'EMAIL'; } if ($this->isColumnModified(CustomerTableMap::PASSWORD)) { - $modifiedColumns[':p' . $index++] = '`PASSWORD`'; + $modifiedColumns[':p' . $index++] = 'PASSWORD'; } if ($this->isColumnModified(CustomerTableMap::ALGO)) { - $modifiedColumns[':p' . $index++] = '`ALGO`'; + $modifiedColumns[':p' . $index++] = 'ALGO'; } if ($this->isColumnModified(CustomerTableMap::RESELLER)) { - $modifiedColumns[':p' . $index++] = '`RESELLER`'; + $modifiedColumns[':p' . $index++] = 'RESELLER'; } if ($this->isColumnModified(CustomerTableMap::LANG)) { - $modifiedColumns[':p' . $index++] = '`LANG`'; + $modifiedColumns[':p' . $index++] = 'LANG'; } if ($this->isColumnModified(CustomerTableMap::SPONSOR)) { - $modifiedColumns[':p' . $index++] = '`SPONSOR`'; + $modifiedColumns[':p' . $index++] = 'SPONSOR'; } if ($this->isColumnModified(CustomerTableMap::DISCOUNT)) { - $modifiedColumns[':p' . $index++] = '`DISCOUNT`'; + $modifiedColumns[':p' . $index++] = 'DISCOUNT'; } if ($this->isColumnModified(CustomerTableMap::REMEMBER_ME_TOKEN)) { - $modifiedColumns[':p' . $index++] = '`REMEMBER_ME_TOKEN`'; + $modifiedColumns[':p' . $index++] = 'REMEMBER_ME_TOKEN'; } if ($this->isColumnModified(CustomerTableMap::REMEMBER_ME_SERIAL)) { - $modifiedColumns[':p' . $index++] = '`REMEMBER_ME_SERIAL`'; + $modifiedColumns[':p' . $index++] = 'REMEMBER_ME_SERIAL'; } if ($this->isColumnModified(CustomerTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CustomerTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `customer` (%s) VALUES (%s)', + 'INSERT INTO customer (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1450,52 +1450,52 @@ abstract class Customer implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`REF`': + case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`TITLE_ID`': + case 'TITLE_ID': $stmt->bindValue($identifier, $this->title_id, PDO::PARAM_INT); break; - case '`FIRSTNAME`': + case 'FIRSTNAME': $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); break; - case '`LASTNAME`': + case 'LASTNAME': $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); break; - case '`EMAIL`': + case 'EMAIL': $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR); break; - case '`PASSWORD`': + case 'PASSWORD': $stmt->bindValue($identifier, $this->password, PDO::PARAM_STR); break; - case '`ALGO`': + case 'ALGO': $stmt->bindValue($identifier, $this->algo, PDO::PARAM_STR); break; - case '`RESELLER`': + case 'RESELLER': $stmt->bindValue($identifier, $this->reseller, PDO::PARAM_INT); break; - case '`LANG`': + case 'LANG': $stmt->bindValue($identifier, $this->lang, PDO::PARAM_STR); break; - case '`SPONSOR`': + case 'SPONSOR': $stmt->bindValue($identifier, $this->sponsor, PDO::PARAM_STR); break; - case '`DISCOUNT`': + case 'DISCOUNT': $stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR); break; - case '`REMEMBER_ME_TOKEN`': + case 'REMEMBER_ME_TOKEN': $stmt->bindValue($identifier, $this->remember_me_token, PDO::PARAM_STR); break; - case '`REMEMBER_ME_SERIAL`': + case 'REMEMBER_ME_SERIAL': $stmt->bindValue($identifier, $this->remember_me_serial, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CustomerQuery.php b/core/lib/Thelia/Model/Base/CustomerQuery.php index 28ccb557b..897bb5ee9 100644 --- a/core/lib/Thelia/Model/Base/CustomerQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerQuery.php @@ -199,7 +199,7 @@ abstract class CustomerQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `REF`, `TITLE_ID`, `FIRSTNAME`, `LASTNAME`, `EMAIL`, `PASSWORD`, `ALGO`, `RESELLER`, `LANG`, `SPONSOR`, `DISCOUNT`, `REMEMBER_ME_TOKEN`, `REMEMBER_ME_SERIAL`, `CREATED_AT`, `UPDATED_AT` FROM `customer` WHERE `ID` = :p0'; + $sql = 'SELECT ID, REF, TITLE_ID, FIRSTNAME, LASTNAME, EMAIL, PASSWORD, ALGO, RESELLER, LANG, SPONSOR, DISCOUNT, REMEMBER_ME_TOKEN, REMEMBER_ME_SERIAL, CREATED_AT, UPDATED_AT FROM customer WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CustomerTitle.php b/core/lib/Thelia/Model/Base/CustomerTitle.php index ccf25fa82..978b779b1 100644 --- a/core/lib/Thelia/Model/Base/CustomerTitle.php +++ b/core/lib/Thelia/Model/Base/CustomerTitle.php @@ -946,23 +946,23 @@ abstract class CustomerTitle implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CustomerTitleTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CustomerTitleTableMap::BY_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`BY_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'BY_DEFAULT'; } if ($this->isColumnModified(CustomerTitleTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(CustomerTitleTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(CustomerTitleTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `customer_title` (%s) VALUES (%s)', + 'INSERT INTO customer_title (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -971,19 +971,19 @@ abstract class CustomerTitle implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`BY_DEFAULT`': + case 'BY_DEFAULT': $stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/CustomerTitleI18n.php b/core/lib/Thelia/Model/Base/CustomerTitleI18n.php index b0e182acc..5c173543b 100644 --- a/core/lib/Thelia/Model/Base/CustomerTitleI18n.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleI18n.php @@ -776,20 +776,20 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(CustomerTitleI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(CustomerTitleI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(CustomerTitleI18nTableMap::SHORT)) { - $modifiedColumns[':p' . $index++] = '`SHORT`'; + $modifiedColumns[':p' . $index++] = 'SHORT'; } if ($this->isColumnModified(CustomerTitleI18nTableMap::LONG)) { - $modifiedColumns[':p' . $index++] = '`LONG`'; + $modifiedColumns[':p' . $index++] = 'LONG'; } $sql = sprintf( - 'INSERT INTO `customer_title_i18n` (%s) VALUES (%s)', + 'INSERT INTO customer_title_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -798,16 +798,16 @@ abstract class CustomerTitleI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`SHORT`': + case 'SHORT': $stmt->bindValue($identifier, $this->short, PDO::PARAM_STR); break; - case '`LONG`': + case 'LONG': $stmt->bindValue($identifier, $this->long, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php index 446d44b1f..4feeab473 100644 --- a/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleI18nQuery.php @@ -139,7 +139,7 @@ abstract class CustomerTitleI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `SHORT`, `LONG` FROM `customer_title_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, SHORT, LONG FROM customer_title_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php index 62fa27684..ea34c8c91 100644 --- a/core/lib/Thelia/Model/Base/CustomerTitleQuery.php +++ b/core/lib/Thelia/Model/Base/CustomerTitleQuery.php @@ -152,7 +152,7 @@ abstract class CustomerTitleQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `BY_DEFAULT`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `customer_title` WHERE `ID` = :p0'; + $sql = 'SELECT ID, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM customer_title WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Feature.php b/core/lib/Thelia/Model/Base/Feature.php index fbe4448f8..7d3a0e7f3 100644 --- a/core/lib/Thelia/Model/Base/Feature.php +++ b/core/lib/Thelia/Model/Base/Feature.php @@ -1020,23 +1020,23 @@ abstract class Feature implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(FeatureTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FeatureTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FeatureTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `feature` (%s) VALUES (%s)', + 'INSERT INTO feature (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1045,19 +1045,19 @@ abstract class Feature implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureAv.php b/core/lib/Thelia/Model/Base/FeatureAv.php index bc19f98a9..7f5191418 100644 --- a/core/lib/Thelia/Model/Base/FeatureAv.php +++ b/core/lib/Thelia/Model/Base/FeatureAv.php @@ -922,23 +922,23 @@ abstract class FeatureAv implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureAvTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureAvTableMap::FEATURE_ID)) { - $modifiedColumns[':p' . $index++] = '`FEATURE_ID`'; + $modifiedColumns[':p' . $index++] = 'FEATURE_ID'; } if ($this->isColumnModified(FeatureAvTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FeatureAvTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FeatureAvTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `feature_av` (%s) VALUES (%s)', + 'INSERT INTO feature_av (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -947,19 +947,19 @@ abstract class FeatureAv implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`FEATURE_ID`': + case 'FEATURE_ID': $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureAvI18n.php b/core/lib/Thelia/Model/Base/FeatureAvI18n.php index 658f4fcc4..e88356a16 100644 --- a/core/lib/Thelia/Model/Base/FeatureAvI18n.php +++ b/core/lib/Thelia/Model/Base/FeatureAvI18n.php @@ -858,26 +858,26 @@ abstract class FeatureAvI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureAvI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureAvI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(FeatureAvI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(FeatureAvI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(FeatureAvI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(FeatureAvI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `feature_av_i18n` (%s) VALUES (%s)', + 'INSERT INTO feature_av_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class FeatureAvI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php b/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php index 88bb52aa5..bab9fd843 100644 --- a/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureAvI18nQuery.php @@ -147,7 +147,7 @@ abstract class FeatureAvI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `feature_av_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM feature_av_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FeatureAvQuery.php b/core/lib/Thelia/Model/Base/FeatureAvQuery.php index 3d8d81a4b..fb3796c97 100644 --- a/core/lib/Thelia/Model/Base/FeatureAvQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureAvQuery.php @@ -152,7 +152,7 @@ abstract class FeatureAvQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `FEATURE_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `feature_av` WHERE `ID` = :p0'; + $sql = 'SELECT ID, FEATURE_ID, POSITION, CREATED_AT, UPDATED_AT FROM feature_av WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FeatureI18n.php b/core/lib/Thelia/Model/Base/FeatureI18n.php index f11699fb9..ed475e87f 100644 --- a/core/lib/Thelia/Model/Base/FeatureI18n.php +++ b/core/lib/Thelia/Model/Base/FeatureI18n.php @@ -858,26 +858,26 @@ abstract class FeatureI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(FeatureI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(FeatureI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(FeatureI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(FeatureI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `feature_i18n` (%s) VALUES (%s)', + 'INSERT INTO feature_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class FeatureI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureI18nQuery.php b/core/lib/Thelia/Model/Base/FeatureI18nQuery.php index 33c171127..5f7080be6 100644 --- a/core/lib/Thelia/Model/Base/FeatureI18nQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureI18nQuery.php @@ -147,7 +147,7 @@ abstract class FeatureI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `feature_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM feature_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FeatureProduct.php b/core/lib/Thelia/Model/Base/FeatureProduct.php index 151f1cc6a..f8ddbd9b7 100644 --- a/core/lib/Thelia/Model/Base/FeatureProduct.php +++ b/core/lib/Thelia/Model/Base/FeatureProduct.php @@ -1008,32 +1008,32 @@ abstract class FeatureProduct implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureProductTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureProductTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(FeatureProductTableMap::FEATURE_ID)) { - $modifiedColumns[':p' . $index++] = '`FEATURE_ID`'; + $modifiedColumns[':p' . $index++] = 'FEATURE_ID'; } if ($this->isColumnModified(FeatureProductTableMap::FEATURE_AV_ID)) { - $modifiedColumns[':p' . $index++] = '`FEATURE_AV_ID`'; + $modifiedColumns[':p' . $index++] = 'FEATURE_AV_ID'; } if ($this->isColumnModified(FeatureProductTableMap::FREE_TEXT_VALUE)) { - $modifiedColumns[':p' . $index++] = '`FREE_TEXT_VALUE`'; + $modifiedColumns[':p' . $index++] = 'FREE_TEXT_VALUE'; } if ($this->isColumnModified(FeatureProductTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FeatureProductTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FeatureProductTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `feature_product` (%s) VALUES (%s)', + 'INSERT INTO feature_product (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1042,28 +1042,28 @@ abstract class FeatureProduct implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`FEATURE_ID`': + case 'FEATURE_ID': $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT); break; - case '`FEATURE_AV_ID`': + case 'FEATURE_AV_ID': $stmt->bindValue($identifier, $this->feature_av_id, PDO::PARAM_INT); break; - case '`FREE_TEXT_VALUE`': + case 'FREE_TEXT_VALUE': $stmt->bindValue($identifier, $this->free_text_value, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureProductQuery.php b/core/lib/Thelia/Model/Base/FeatureProductQuery.php index b1d46a12f..eb2ee7ec1 100644 --- a/core/lib/Thelia/Model/Base/FeatureProductQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureProductQuery.php @@ -163,7 +163,7 @@ abstract class FeatureProductQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `FEATURE_ID`, `FEATURE_AV_ID`, `FREE_TEXT_VALUE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `feature_product` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, FEATURE_ID, FEATURE_AV_ID, FREE_TEXT_VALUE, POSITION, CREATED_AT, UPDATED_AT FROM feature_product WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FeatureQuery.php b/core/lib/Thelia/Model/Base/FeatureQuery.php index d6e20ea15..097646c87 100644 --- a/core/lib/Thelia/Model/Base/FeatureQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureQuery.php @@ -156,7 +156,7 @@ abstract class FeatureQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `feature` WHERE `ID` = :p0'; + $sql = 'SELECT ID, VISIBLE, POSITION, CREATED_AT, UPDATED_AT FROM feature WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FeatureTemplate.php b/core/lib/Thelia/Model/Base/FeatureTemplate.php index 920c16cde..bc7b4f921 100644 --- a/core/lib/Thelia/Model/Base/FeatureTemplate.php +++ b/core/lib/Thelia/Model/Base/FeatureTemplate.php @@ -904,26 +904,26 @@ abstract class FeatureTemplate implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FeatureTemplateTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FeatureTemplateTableMap::FEATURE_ID)) { - $modifiedColumns[':p' . $index++] = '`FEATURE_ID`'; + $modifiedColumns[':p' . $index++] = 'FEATURE_ID'; } if ($this->isColumnModified(FeatureTemplateTableMap::TEMPLATE_ID)) { - $modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`'; + $modifiedColumns[':p' . $index++] = 'TEMPLATE_ID'; } if ($this->isColumnModified(FeatureTemplateTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FeatureTemplateTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FeatureTemplateTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `feature_template` (%s) VALUES (%s)', + 'INSERT INTO feature_template (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -932,22 +932,22 @@ abstract class FeatureTemplate implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`FEATURE_ID`': + case 'FEATURE_ID': $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT); break; - case '`TEMPLATE_ID`': + case 'TEMPLATE_ID': $stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FeatureTemplateQuery.php b/core/lib/Thelia/Model/Base/FeatureTemplateQuery.php index 8b4f0893e..cccad15ae 100644 --- a/core/lib/Thelia/Model/Base/FeatureTemplateQuery.php +++ b/core/lib/Thelia/Model/Base/FeatureTemplateQuery.php @@ -151,7 +151,7 @@ abstract class FeatureTemplateQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `FEATURE_ID`, `TEMPLATE_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `feature_template` WHERE `ID` = :p0'; + $sql = 'SELECT ID, FEATURE_ID, TEMPLATE_ID, POSITION, CREATED_AT, UPDATED_AT FROM feature_template WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Folder.php b/core/lib/Thelia/Model/Base/Folder.php index 6b08987e0..20a7e8dbc 100644 --- a/core/lib/Thelia/Model/Base/Folder.php +++ b/core/lib/Thelia/Model/Base/Folder.php @@ -1250,35 +1250,35 @@ abstract class Folder implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderTableMap::PARENT)) { - $modifiedColumns[':p' . $index++] = '`PARENT`'; + $modifiedColumns[':p' . $index++] = 'PARENT'; } if ($this->isColumnModified(FolderTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(FolderTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FolderTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FolderTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(FolderTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(FolderTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(FolderTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `folder` (%s) VALUES (%s)', + 'INSERT INTO folder (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1287,31 +1287,31 @@ abstract class Folder implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PARENT`': + case 'PARENT': $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FolderDocument.php b/core/lib/Thelia/Model/Base/FolderDocument.php index abd2b3429..ea1a35d74 100644 --- a/core/lib/Thelia/Model/Base/FolderDocument.php +++ b/core/lib/Thelia/Model/Base/FolderDocument.php @@ -930,26 +930,26 @@ abstract class FolderDocument implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderDocumentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderDocumentTableMap::FOLDER_ID)) { - $modifiedColumns[':p' . $index++] = '`FOLDER_ID`'; + $modifiedColumns[':p' . $index++] = 'FOLDER_ID'; } if ($this->isColumnModified(FolderDocumentTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(FolderDocumentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FolderDocumentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FolderDocumentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `folder_document` (%s) VALUES (%s)', + 'INSERT INTO folder_document (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class FolderDocument implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`FOLDER_ID`': + case 'FOLDER_ID': $stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FolderDocumentI18n.php b/core/lib/Thelia/Model/Base/FolderDocumentI18n.php index a24ea7482..600890a03 100644 --- a/core/lib/Thelia/Model/Base/FolderDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/FolderDocumentI18n.php @@ -858,26 +858,26 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderDocumentI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderDocumentI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(FolderDocumentI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(FolderDocumentI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(FolderDocumentI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(FolderDocumentI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `folder_document_i18n` (%s) VALUES (%s)', + 'INSERT INTO folder_document_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class FolderDocumentI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php b/core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php index f053ac652..073cef92e 100644 --- a/core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php +++ b/core/lib/Thelia/Model/Base/FolderDocumentI18nQuery.php @@ -147,7 +147,7 @@ abstract class FolderDocumentI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `folder_document_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_document_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderDocumentQuery.php b/core/lib/Thelia/Model/Base/FolderDocumentQuery.php index c438576a6..b1c41a29e 100644 --- a/core/lib/Thelia/Model/Base/FolderDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/FolderDocumentQuery.php @@ -152,7 +152,7 @@ abstract class FolderDocumentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `FOLDER_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `folder_document` WHERE `ID` = :p0'; + $sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_document WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderI18n.php b/core/lib/Thelia/Model/Base/FolderI18n.php index ef0da9d3e..ec57cff1d 100644 --- a/core/lib/Thelia/Model/Base/FolderI18n.php +++ b/core/lib/Thelia/Model/Base/FolderI18n.php @@ -981,35 +981,35 @@ abstract class FolderI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(FolderI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(FolderI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(FolderI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(FolderI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } if ($this->isColumnModified(FolderI18nTableMap::META_TITLE)) { - $modifiedColumns[':p' . $index++] = '`META_TITLE`'; + $modifiedColumns[':p' . $index++] = 'META_TITLE'; } if ($this->isColumnModified(FolderI18nTableMap::META_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`META_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'META_DESCRIPTION'; } if ($this->isColumnModified(FolderI18nTableMap::META_KEYWORDS)) { - $modifiedColumns[':p' . $index++] = '`META_KEYWORDS`'; + $modifiedColumns[':p' . $index++] = 'META_KEYWORDS'; } $sql = sprintf( - 'INSERT INTO `folder_i18n` (%s) VALUES (%s)', + 'INSERT INTO folder_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1018,31 +1018,31 @@ abstract class FolderI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; - case '`META_TITLE`': + case 'META_TITLE': $stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR); break; - case '`META_DESCRIPTION`': + case 'META_DESCRIPTION': $stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR); break; - case '`META_KEYWORDS`': + case 'META_KEYWORDS': $stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FolderI18nQuery.php b/core/lib/Thelia/Model/Base/FolderI18nQuery.php index 787657033..5a95c3689 100644 --- a/core/lib/Thelia/Model/Base/FolderI18nQuery.php +++ b/core/lib/Thelia/Model/Base/FolderI18nQuery.php @@ -159,7 +159,7 @@ abstract class FolderI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS` FROM `folder_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM folder_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderImage.php b/core/lib/Thelia/Model/Base/FolderImage.php index 6525246de..2440c7232 100644 --- a/core/lib/Thelia/Model/Base/FolderImage.php +++ b/core/lib/Thelia/Model/Base/FolderImage.php @@ -930,26 +930,26 @@ abstract class FolderImage implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderImageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderImageTableMap::FOLDER_ID)) { - $modifiedColumns[':p' . $index++] = '`FOLDER_ID`'; + $modifiedColumns[':p' . $index++] = 'FOLDER_ID'; } if ($this->isColumnModified(FolderImageTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(FolderImageTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FolderImageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FolderImageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `folder_image` (%s) VALUES (%s)', + 'INSERT INTO folder_image (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class FolderImage implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`FOLDER_ID`': + case 'FOLDER_ID': $stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/FolderImageI18n.php b/core/lib/Thelia/Model/Base/FolderImageI18n.php index 95fb29b2a..e080b4b5c 100644 --- a/core/lib/Thelia/Model/Base/FolderImageI18n.php +++ b/core/lib/Thelia/Model/Base/FolderImageI18n.php @@ -858,26 +858,26 @@ abstract class FolderImageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderImageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderImageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(FolderImageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(FolderImageI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(FolderImageI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(FolderImageI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `folder_image_i18n` (%s) VALUES (%s)', + 'INSERT INTO folder_image_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class FolderImageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FolderImageI18nQuery.php b/core/lib/Thelia/Model/Base/FolderImageI18nQuery.php index 15381439b..0e7e0ab55 100644 --- a/core/lib/Thelia/Model/Base/FolderImageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/FolderImageI18nQuery.php @@ -147,7 +147,7 @@ abstract class FolderImageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `folder_image_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM folder_image_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderImageQuery.php b/core/lib/Thelia/Model/Base/FolderImageQuery.php index 6466b83a3..ca12e098e 100644 --- a/core/lib/Thelia/Model/Base/FolderImageQuery.php +++ b/core/lib/Thelia/Model/Base/FolderImageQuery.php @@ -152,7 +152,7 @@ abstract class FolderImageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `FOLDER_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `folder_image` WHERE `ID` = :p0'; + $sql = 'SELECT ID, FOLDER_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM folder_image WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderQuery.php b/core/lib/Thelia/Model/Base/FolderQuery.php index 473ad2234..d7d6794c5 100644 --- a/core/lib/Thelia/Model/Base/FolderQuery.php +++ b/core/lib/Thelia/Model/Base/FolderQuery.php @@ -183,7 +183,7 @@ abstract class FolderQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PARENT`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `folder` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PARENT, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM folder WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/FolderVersion.php b/core/lib/Thelia/Model/Base/FolderVersion.php index a0678e1b7..657bdeb44 100644 --- a/core/lib/Thelia/Model/Base/FolderVersion.php +++ b/core/lib/Thelia/Model/Base/FolderVersion.php @@ -1019,35 +1019,35 @@ abstract class FolderVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(FolderVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(FolderVersionTableMap::PARENT)) { - $modifiedColumns[':p' . $index++] = '`PARENT`'; + $modifiedColumns[':p' . $index++] = 'PARENT'; } if ($this->isColumnModified(FolderVersionTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(FolderVersionTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(FolderVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(FolderVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(FolderVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(FolderVersionTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(FolderVersionTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `folder_version` (%s) VALUES (%s)', + 'INSERT INTO folder_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1056,31 +1056,31 @@ abstract class FolderVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PARENT`': + case 'PARENT': $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/FolderVersionQuery.php b/core/lib/Thelia/Model/Base/FolderVersionQuery.php index 086551003..22090d7be 100644 --- a/core/lib/Thelia/Model/Base/FolderVersionQuery.php +++ b/core/lib/Thelia/Model/Base/FolderVersionQuery.php @@ -159,7 +159,7 @@ abstract class FolderVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PARENT`, `VISIBLE`, `POSITION`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `folder_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, PARENT, VISIBLE, POSITION, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM folder_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Lang.php b/core/lib/Thelia/Model/Base/Lang.php index f01227211..ac6f1f63c 100644 --- a/core/lib/Thelia/Model/Base/Lang.php +++ b/core/lib/Thelia/Model/Base/Lang.php @@ -1258,53 +1258,53 @@ abstract class Lang implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(LangTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(LangTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(LangTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(LangTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(LangTableMap::URL)) { - $modifiedColumns[':p' . $index++] = '`URL`'; + $modifiedColumns[':p' . $index++] = 'URL'; } if ($this->isColumnModified(LangTableMap::DATE_FORMAT)) { - $modifiedColumns[':p' . $index++] = '`DATE_FORMAT`'; + $modifiedColumns[':p' . $index++] = 'DATE_FORMAT'; } if ($this->isColumnModified(LangTableMap::TIME_FORMAT)) { - $modifiedColumns[':p' . $index++] = '`TIME_FORMAT`'; + $modifiedColumns[':p' . $index++] = 'TIME_FORMAT'; } if ($this->isColumnModified(LangTableMap::DATETIME_FORMAT)) { - $modifiedColumns[':p' . $index++] = '`DATETIME_FORMAT`'; + $modifiedColumns[':p' . $index++] = 'DATETIME_FORMAT'; } if ($this->isColumnModified(LangTableMap::DECIMAL_SEPARATOR)) { - $modifiedColumns[':p' . $index++] = '`DECIMAL_SEPARATOR`'; + $modifiedColumns[':p' . $index++] = 'DECIMAL_SEPARATOR'; } if ($this->isColumnModified(LangTableMap::THOUSANDS_SEPARATOR)) { - $modifiedColumns[':p' . $index++] = '`THOUSANDS_SEPARATOR`'; + $modifiedColumns[':p' . $index++] = 'THOUSANDS_SEPARATOR'; } if ($this->isColumnModified(LangTableMap::DECIMALS)) { - $modifiedColumns[':p' . $index++] = '`DECIMALS`'; + $modifiedColumns[':p' . $index++] = 'DECIMALS'; } if ($this->isColumnModified(LangTableMap::BY_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`BY_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'BY_DEFAULT'; } if ($this->isColumnModified(LangTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(LangTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(LangTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `lang` (%s) VALUES (%s)', + 'INSERT INTO lang (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1313,49 +1313,49 @@ abstract class Lang implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`URL`': + case 'URL': $stmt->bindValue($identifier, $this->url, PDO::PARAM_STR); break; - case '`DATE_FORMAT`': + case 'DATE_FORMAT': $stmt->bindValue($identifier, $this->date_format, PDO::PARAM_STR); break; - case '`TIME_FORMAT`': + case 'TIME_FORMAT': $stmt->bindValue($identifier, $this->time_format, PDO::PARAM_STR); break; - case '`DATETIME_FORMAT`': + case 'DATETIME_FORMAT': $stmt->bindValue($identifier, $this->datetime_format, PDO::PARAM_STR); break; - case '`DECIMAL_SEPARATOR`': + case 'DECIMAL_SEPARATOR': $stmt->bindValue($identifier, $this->decimal_separator, PDO::PARAM_STR); break; - case '`THOUSANDS_SEPARATOR`': + case 'THOUSANDS_SEPARATOR': $stmt->bindValue($identifier, $this->thousands_separator, PDO::PARAM_STR); break; - case '`DECIMALS`': + case 'DECIMALS': $stmt->bindValue($identifier, $this->decimals, PDO::PARAM_STR); break; - case '`BY_DEFAULT`': + case 'BY_DEFAULT': $stmt->bindValue($identifier, $this->by_default, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/LangQuery.php b/core/lib/Thelia/Model/Base/LangQuery.php index f4f480fa9..045ee0887 100644 --- a/core/lib/Thelia/Model/Base/LangQuery.php +++ b/core/lib/Thelia/Model/Base/LangQuery.php @@ -183,7 +183,7 @@ abstract class LangQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `TITLE`, `CODE`, `LOCALE`, `URL`, `DATE_FORMAT`, `TIME_FORMAT`, `DATETIME_FORMAT`, `DECIMAL_SEPARATOR`, `THOUSANDS_SEPARATOR`, `DECIMALS`, `BY_DEFAULT`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `lang` WHERE `ID` = :p0'; + $sql = 'SELECT ID, TITLE, CODE, LOCALE, URL, DATE_FORMAT, TIME_FORMAT, DATETIME_FORMAT, DECIMAL_SEPARATOR, THOUSANDS_SEPARATOR, DECIMALS, BY_DEFAULT, POSITION, CREATED_AT, UPDATED_AT FROM lang WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Message.php b/core/lib/Thelia/Model/Base/Message.php index ef8b825c3..351aa3818 100644 --- a/core/lib/Thelia/Model/Base/Message.php +++ b/core/lib/Thelia/Model/Base/Message.php @@ -1233,44 +1233,44 @@ abstract class Message implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(MessageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(MessageTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } if ($this->isColumnModified(MessageTableMap::SECURED)) { - $modifiedColumns[':p' . $index++] = '`SECURED`'; + $modifiedColumns[':p' . $index++] = 'SECURED'; } if ($this->isColumnModified(MessageTableMap::TEXT_LAYOUT_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`TEXT_LAYOUT_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'TEXT_LAYOUT_FILE_NAME'; } if ($this->isColumnModified(MessageTableMap::TEXT_TEMPLATE_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`TEXT_TEMPLATE_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'TEXT_TEMPLATE_FILE_NAME'; } if ($this->isColumnModified(MessageTableMap::HTML_LAYOUT_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`HTML_LAYOUT_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'HTML_LAYOUT_FILE_NAME'; } if ($this->isColumnModified(MessageTableMap::HTML_TEMPLATE_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`HTML_TEMPLATE_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'HTML_TEMPLATE_FILE_NAME'; } if ($this->isColumnModified(MessageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(MessageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(MessageTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(MessageTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(MessageTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `message` (%s) VALUES (%s)', + 'INSERT INTO message (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1279,40 +1279,40 @@ abstract class Message implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; - case '`SECURED`': + case 'SECURED': $stmt->bindValue($identifier, $this->secured, PDO::PARAM_INT); break; - case '`TEXT_LAYOUT_FILE_NAME`': + case 'TEXT_LAYOUT_FILE_NAME': $stmt->bindValue($identifier, $this->text_layout_file_name, PDO::PARAM_STR); break; - case '`TEXT_TEMPLATE_FILE_NAME`': + case 'TEXT_TEMPLATE_FILE_NAME': $stmt->bindValue($identifier, $this->text_template_file_name, PDO::PARAM_STR); break; - case '`HTML_LAYOUT_FILE_NAME`': + case 'HTML_LAYOUT_FILE_NAME': $stmt->bindValue($identifier, $this->html_layout_file_name, PDO::PARAM_STR); break; - case '`HTML_TEMPLATE_FILE_NAME`': + case 'HTML_TEMPLATE_FILE_NAME': $stmt->bindValue($identifier, $this->html_template_file_name, PDO::PARAM_STR); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/MessageI18n.php b/core/lib/Thelia/Model/Base/MessageI18n.php index 615169d63..42923cb69 100644 --- a/core/lib/Thelia/Model/Base/MessageI18n.php +++ b/core/lib/Thelia/Model/Base/MessageI18n.php @@ -858,26 +858,26 @@ abstract class MessageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(MessageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(MessageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(MessageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(MessageI18nTableMap::SUBJECT)) { - $modifiedColumns[':p' . $index++] = '`SUBJECT`'; + $modifiedColumns[':p' . $index++] = 'SUBJECT'; } if ($this->isColumnModified(MessageI18nTableMap::TEXT_MESSAGE)) { - $modifiedColumns[':p' . $index++] = '`TEXT_MESSAGE`'; + $modifiedColumns[':p' . $index++] = 'TEXT_MESSAGE'; } if ($this->isColumnModified(MessageI18nTableMap::HTML_MESSAGE)) { - $modifiedColumns[':p' . $index++] = '`HTML_MESSAGE`'; + $modifiedColumns[':p' . $index++] = 'HTML_MESSAGE'; } $sql = sprintf( - 'INSERT INTO `message_i18n` (%s) VALUES (%s)', + 'INSERT INTO message_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class MessageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`SUBJECT`': + case 'SUBJECT': $stmt->bindValue($identifier, $this->subject, PDO::PARAM_STR); break; - case '`TEXT_MESSAGE`': + case 'TEXT_MESSAGE': $stmt->bindValue($identifier, $this->text_message, PDO::PARAM_STR); break; - case '`HTML_MESSAGE`': + case 'HTML_MESSAGE': $stmt->bindValue($identifier, $this->html_message, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/MessageI18nQuery.php b/core/lib/Thelia/Model/Base/MessageI18nQuery.php index 6ef0a1c10..f63ca675a 100644 --- a/core/lib/Thelia/Model/Base/MessageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/MessageI18nQuery.php @@ -147,7 +147,7 @@ abstract class MessageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `SUBJECT`, `TEXT_MESSAGE`, `HTML_MESSAGE` FROM `message_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, SUBJECT, TEXT_MESSAGE, HTML_MESSAGE FROM message_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/MessageQuery.php b/core/lib/Thelia/Model/Base/MessageQuery.php index 1492b0834..3f412191f 100644 --- a/core/lib/Thelia/Model/Base/MessageQuery.php +++ b/core/lib/Thelia/Model/Base/MessageQuery.php @@ -183,7 +183,7 @@ abstract class MessageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `NAME`, `SECURED`, `TEXT_LAYOUT_FILE_NAME`, `TEXT_TEMPLATE_FILE_NAME`, `HTML_LAYOUT_FILE_NAME`, `HTML_TEMPLATE_FILE_NAME`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `message` WHERE `ID` = :p0'; + $sql = 'SELECT ID, NAME, SECURED, TEXT_LAYOUT_FILE_NAME, TEXT_TEMPLATE_FILE_NAME, HTML_LAYOUT_FILE_NAME, HTML_TEMPLATE_FILE_NAME, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM message WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/MessageVersion.php b/core/lib/Thelia/Model/Base/MessageVersion.php index 0db39b3ec..6fe06658c 100644 --- a/core/lib/Thelia/Model/Base/MessageVersion.php +++ b/core/lib/Thelia/Model/Base/MessageVersion.php @@ -1142,44 +1142,44 @@ abstract class MessageVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(MessageVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(MessageVersionTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } if ($this->isColumnModified(MessageVersionTableMap::SECURED)) { - $modifiedColumns[':p' . $index++] = '`SECURED`'; + $modifiedColumns[':p' . $index++] = 'SECURED'; } if ($this->isColumnModified(MessageVersionTableMap::TEXT_LAYOUT_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`TEXT_LAYOUT_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'TEXT_LAYOUT_FILE_NAME'; } if ($this->isColumnModified(MessageVersionTableMap::TEXT_TEMPLATE_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`TEXT_TEMPLATE_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'TEXT_TEMPLATE_FILE_NAME'; } if ($this->isColumnModified(MessageVersionTableMap::HTML_LAYOUT_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`HTML_LAYOUT_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'HTML_LAYOUT_FILE_NAME'; } if ($this->isColumnModified(MessageVersionTableMap::HTML_TEMPLATE_FILE_NAME)) { - $modifiedColumns[':p' . $index++] = '`HTML_TEMPLATE_FILE_NAME`'; + $modifiedColumns[':p' . $index++] = 'HTML_TEMPLATE_FILE_NAME'; } if ($this->isColumnModified(MessageVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(MessageVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(MessageVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(MessageVersionTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(MessageVersionTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `message_version` (%s) VALUES (%s)', + 'INSERT INTO message_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1188,40 +1188,40 @@ abstract class MessageVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; - case '`SECURED`': + case 'SECURED': $stmt->bindValue($identifier, $this->secured, PDO::PARAM_INT); break; - case '`TEXT_LAYOUT_FILE_NAME`': + case 'TEXT_LAYOUT_FILE_NAME': $stmt->bindValue($identifier, $this->text_layout_file_name, PDO::PARAM_STR); break; - case '`TEXT_TEMPLATE_FILE_NAME`': + case 'TEXT_TEMPLATE_FILE_NAME': $stmt->bindValue($identifier, $this->text_template_file_name, PDO::PARAM_STR); break; - case '`HTML_LAYOUT_FILE_NAME`': + case 'HTML_LAYOUT_FILE_NAME': $stmt->bindValue($identifier, $this->html_layout_file_name, PDO::PARAM_STR); break; - case '`HTML_TEMPLATE_FILE_NAME`': + case 'HTML_TEMPLATE_FILE_NAME': $stmt->bindValue($identifier, $this->html_template_file_name, PDO::PARAM_STR); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/MessageVersionQuery.php b/core/lib/Thelia/Model/Base/MessageVersionQuery.php index 5a2a15a03..638ed5e5c 100644 --- a/core/lib/Thelia/Model/Base/MessageVersionQuery.php +++ b/core/lib/Thelia/Model/Base/MessageVersionQuery.php @@ -171,7 +171,7 @@ abstract class MessageVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `NAME`, `SECURED`, `TEXT_LAYOUT_FILE_NAME`, `TEXT_TEMPLATE_FILE_NAME`, `HTML_LAYOUT_FILE_NAME`, `HTML_TEMPLATE_FILE_NAME`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `message_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, NAME, SECURED, TEXT_LAYOUT_FILE_NAME, TEXT_TEMPLATE_FILE_NAME, HTML_LAYOUT_FILE_NAME, HTML_TEMPLATE_FILE_NAME, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM message_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Module.php b/core/lib/Thelia/Model/Base/Module.php index 418417a1a..3331bd57c 100644 --- a/core/lib/Thelia/Model/Base/Module.php +++ b/core/lib/Thelia/Model/Base/Module.php @@ -1148,32 +1148,32 @@ abstract class Module implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ModuleTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ModuleTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(ModuleTableMap::TYPE)) { - $modifiedColumns[':p' . $index++] = '`TYPE`'; + $modifiedColumns[':p' . $index++] = 'TYPE'; } if ($this->isColumnModified(ModuleTableMap::ACTIVATE)) { - $modifiedColumns[':p' . $index++] = '`ACTIVATE`'; + $modifiedColumns[':p' . $index++] = 'ACTIVATE'; } if ($this->isColumnModified(ModuleTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ModuleTableMap::FULL_NAMESPACE)) { - $modifiedColumns[':p' . $index++] = '`FULL_NAMESPACE`'; + $modifiedColumns[':p' . $index++] = 'FULL_NAMESPACE'; } if ($this->isColumnModified(ModuleTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ModuleTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `module` (%s) VALUES (%s)', + 'INSERT INTO module (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1182,28 +1182,28 @@ abstract class Module implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); break; - case '`TYPE`': + case 'TYPE': $stmt->bindValue($identifier, $this->type, PDO::PARAM_INT); break; - case '`ACTIVATE`': + case 'ACTIVATE': $stmt->bindValue($identifier, $this->activate, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`FULL_NAMESPACE`': + case 'FULL_NAMESPACE': $stmt->bindValue($identifier, $this->full_namespace, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ModuleI18n.php b/core/lib/Thelia/Model/Base/ModuleI18n.php index 7c52f409f..359fb530e 100644 --- a/core/lib/Thelia/Model/Base/ModuleI18n.php +++ b/core/lib/Thelia/Model/Base/ModuleI18n.php @@ -858,26 +858,26 @@ abstract class ModuleI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ModuleI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ModuleI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ModuleI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ModuleI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ModuleI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ModuleI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `module_i18n` (%s) VALUES (%s)', + 'INSERT INTO module_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ModuleI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ModuleI18nQuery.php b/core/lib/Thelia/Model/Base/ModuleI18nQuery.php index 9bf96ccd5..d3d4694fb 100644 --- a/core/lib/Thelia/Model/Base/ModuleI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleI18nQuery.php @@ -147,7 +147,7 @@ abstract class ModuleI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `module_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM module_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ModuleImage.php b/core/lib/Thelia/Model/Base/ModuleImage.php index f03e149a2..4185d26c9 100644 --- a/core/lib/Thelia/Model/Base/ModuleImage.php +++ b/core/lib/Thelia/Model/Base/ModuleImage.php @@ -930,26 +930,26 @@ abstract class ModuleImage implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ModuleImageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ModuleImageTableMap::MODULE_ID)) { - $modifiedColumns[':p' . $index++] = '`MODULE_ID`'; + $modifiedColumns[':p' . $index++] = 'MODULE_ID'; } if ($this->isColumnModified(ModuleImageTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(ModuleImageTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ModuleImageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ModuleImageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `module_image` (%s) VALUES (%s)', + 'INSERT INTO module_image (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class ModuleImage implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`MODULE_ID`': + case 'MODULE_ID': $stmt->bindValue($identifier, $this->module_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ModuleImageI18n.php b/core/lib/Thelia/Model/Base/ModuleImageI18n.php index d83d11229..92a19a601 100644 --- a/core/lib/Thelia/Model/Base/ModuleImageI18n.php +++ b/core/lib/Thelia/Model/Base/ModuleImageI18n.php @@ -858,26 +858,26 @@ abstract class ModuleImageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ModuleImageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ModuleImageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ModuleImageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ModuleImageI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ModuleImageI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ModuleImageI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `module_image_i18n` (%s) VALUES (%s)', + 'INSERT INTO module_image_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ModuleImageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php index 50e7e61dd..e5b6813d6 100644 --- a/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleImageI18nQuery.php @@ -147,7 +147,7 @@ abstract class ModuleImageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `module_image_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM module_image_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ModuleImageQuery.php b/core/lib/Thelia/Model/Base/ModuleImageQuery.php index e5813c649..966e686ad 100644 --- a/core/lib/Thelia/Model/Base/ModuleImageQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleImageQuery.php @@ -152,7 +152,7 @@ abstract class ModuleImageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `MODULE_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `module_image` WHERE `ID` = :p0'; + $sql = 'SELECT ID, MODULE_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM module_image WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ModuleQuery.php b/core/lib/Thelia/Model/Base/ModuleQuery.php index 006bfbe7a..84ae33f68 100644 --- a/core/lib/Thelia/Model/Base/ModuleQuery.php +++ b/core/lib/Thelia/Model/Base/ModuleQuery.php @@ -176,7 +176,7 @@ abstract class ModuleQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `TYPE`, `ACTIVATE`, `POSITION`, `FULL_NAMESPACE`, `CREATED_AT`, `UPDATED_AT` FROM `module` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, TYPE, ACTIVATE, POSITION, FULL_NAMESPACE, CREATED_AT, UPDATED_AT FROM module WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Newsletter.php b/core/lib/Thelia/Model/Base/Newsletter.php index e9cd4077c..5282045d3 100644 --- a/core/lib/Thelia/Model/Base/Newsletter.php +++ b/core/lib/Thelia/Model/Base/Newsletter.php @@ -896,29 +896,29 @@ abstract class Newsletter implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(NewsletterTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(NewsletterTableMap::EMAIL)) { - $modifiedColumns[':p' . $index++] = '`EMAIL`'; + $modifiedColumns[':p' . $index++] = 'EMAIL'; } if ($this->isColumnModified(NewsletterTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; } if ($this->isColumnModified(NewsletterTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'LASTNAME'; } if ($this->isColumnModified(NewsletterTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(NewsletterTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(NewsletterTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `newsletter` (%s) VALUES (%s)', + 'INSERT INTO newsletter (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -927,25 +927,25 @@ abstract class Newsletter implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`EMAIL`': + case 'EMAIL': $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR); break; - case '`FIRSTNAME`': + case 'FIRSTNAME': $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); break; - case '`LASTNAME`': + case 'LASTNAME': $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/NewsletterQuery.php b/core/lib/Thelia/Model/Base/NewsletterQuery.php index 7968412cf..ef9ac0a22 100644 --- a/core/lib/Thelia/Model/Base/NewsletterQuery.php +++ b/core/lib/Thelia/Model/Base/NewsletterQuery.php @@ -144,7 +144,7 @@ abstract class NewsletterQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `EMAIL`, `FIRSTNAME`, `LASTNAME`, `LOCALE`, `CREATED_AT`, `UPDATED_AT` FROM `newsletter` WHERE `ID` = :p0'; + $sql = 'SELECT ID, EMAIL, FIRSTNAME, LASTNAME, LOCALE, CREATED_AT, UPDATED_AT FROM newsletter WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Order.php b/core/lib/Thelia/Model/Base/Order.php index c0f5111ca..befa2abfe 100644 --- a/core/lib/Thelia/Model/Base/Order.php +++ b/core/lib/Thelia/Model/Base/Order.php @@ -17,6 +17,8 @@ use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Map\TableMap; use Propel\Runtime\Parser\AbstractParser; use Propel\Runtime\Util\PropelDateTime; +use Thelia\Model\CouponOrder as ChildCouponOrder; +use Thelia\Model\CouponOrderQuery as ChildCouponOrderQuery; use Thelia\Model\Currency as ChildCurrency; use Thelia\Model\CurrencyQuery as ChildCurrencyQuery; use Thelia\Model\Customer as ChildCustomer; @@ -28,8 +30,6 @@ use Thelia\Model\ModuleQuery as ChildModuleQuery; use Thelia\Model\Order as ChildOrder; use Thelia\Model\OrderAddress as ChildOrderAddress; use Thelia\Model\OrderAddressQuery as ChildOrderAddressQuery; -use Thelia\Model\OrderCoupon as ChildOrderCoupon; -use Thelia\Model\OrderCouponQuery as ChildOrderCouponQuery; use Thelia\Model\OrderProduct as ChildOrderProduct; use Thelia\Model\OrderProductQuery as ChildOrderProductQuery; use Thelia\Model\OrderQuery as ChildOrderQuery; @@ -137,12 +137,6 @@ abstract class Order implements ActiveRecordInterface */ protected $invoice_ref; - /** - * The value for the discount field. - * @var double - */ - protected $discount; - /** * The value for the postage field. * @var double @@ -232,10 +226,10 @@ abstract class Order implements ActiveRecordInterface protected $collOrderProductsPartial; /** - * @var ObjectCollection|ChildOrderCoupon[] Collection to store aggregation of ChildOrderCoupon objects. + * @var ObjectCollection|ChildCouponOrder[] Collection to store aggregation of ChildCouponOrder objects. */ - protected $collOrderCoupons; - protected $collOrderCouponsPartial; + protected $collCouponOrders; + protected $collCouponOrdersPartial; /** * Flag to prevent endless save loop, if this object is referenced @@ -255,7 +249,7 @@ abstract class Order implements ActiveRecordInterface * An array of objects scheduled for deletion. * @var ObjectCollection */ - protected $orderCouponsScheduledForDeletion = null; + protected $couponOrdersScheduledForDeletion = null; /** * Initializes internal state of Thelia\Model\Base\Order object. @@ -645,17 +639,6 @@ abstract class Order implements ActiveRecordInterface return $this->invoice_ref; } - /** - * Get the [discount] column value. - * - * @return double - */ - public function getDiscount() - { - - return $this->discount; - } - /** * Get the [postage] column value. * @@ -998,27 +981,6 @@ abstract class Order implements ActiveRecordInterface return $this; } // setInvoiceRef() - /** - * Set the value of [discount] column. - * - * @param double $v new value - * @return \Thelia\Model\Order 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[] = OrderTableMap::DISCOUNT; - } - - - return $this; - } // setDiscount() - /** * Set the value of [postage] column. * @@ -1255,31 +1217,28 @@ abstract class Order implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : OrderTableMap::translateFieldName('InvoiceRef', TableMap::TYPE_PHPNAME, $indexType)]; $this->invoice_ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : OrderTableMap::translateFieldName('Discount', TableMap::TYPE_PHPNAME, $indexType)]; - $this->discount = (null !== $col) ? (double) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderTableMap::translateFieldName('Postage', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : OrderTableMap::translateFieldName('Postage', TableMap::TYPE_PHPNAME, $indexType)]; $this->postage = (null !== $col) ? (double) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderTableMap::translateFieldName('PaymentModuleId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 12 + $startcol : OrderTableMap::translateFieldName('PaymentModuleId', TableMap::TYPE_PHPNAME, $indexType)]; $this->payment_module_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderTableMap::translateFieldName('DeliveryModuleId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderTableMap::translateFieldName('DeliveryModuleId', TableMap::TYPE_PHPNAME, $indexType)]; $this->delivery_module_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderTableMap::translateFieldName('StatusId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderTableMap::translateFieldName('StatusId', TableMap::TYPE_PHPNAME, $indexType)]; $this->status_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderTableMap::translateFieldName('LangId', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderTableMap::translateFieldName('LangId', TableMap::TYPE_PHPNAME, $indexType)]; $this->lang_id = (null !== $col) ? (int) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : OrderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } $this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 18 + $startcol : OrderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : OrderTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)]; if ($col === '0000-00-00 00:00:00') { $col = null; } @@ -1292,7 +1251,7 @@ abstract class Order implements ActiveRecordInterface $this->ensureConsistency(); } - return $startcol + 19; // 19 = OrderTableMap::NUM_HYDRATE_COLUMNS. + return $startcol + 18; // 18 = OrderTableMap::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating \Thelia\Model\Order object", 0, $e); @@ -1387,7 +1346,7 @@ abstract class Order implements ActiveRecordInterface $this->aLang = null; $this->collOrderProducts = null; - $this->collOrderCoupons = null; + $this->collCouponOrders = null; } // if (deep) } @@ -1600,17 +1559,17 @@ abstract class Order implements ActiveRecordInterface } } - if ($this->orderCouponsScheduledForDeletion !== null) { - if (!$this->orderCouponsScheduledForDeletion->isEmpty()) { - \Thelia\Model\OrderCouponQuery::create() - ->filterByPrimaryKeys($this->orderCouponsScheduledForDeletion->getPrimaryKeys(false)) + if ($this->couponOrdersScheduledForDeletion !== null) { + if (!$this->couponOrdersScheduledForDeletion->isEmpty()) { + \Thelia\Model\CouponOrderQuery::create() + ->filterByPrimaryKeys($this->couponOrdersScheduledForDeletion->getPrimaryKeys(false)) ->delete($con); - $this->orderCouponsScheduledForDeletion = null; + $this->couponOrdersScheduledForDeletion = null; } } - if ($this->collOrderCoupons !== null) { - foreach ($this->collOrderCoupons as $referrerFK) { + if ($this->collCouponOrders !== null) { + foreach ($this->collCouponOrders as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } @@ -1644,65 +1603,62 @@ abstract class Order implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderTableMap::REF)) { - $modifiedColumns[':p' . $index++] = '`REF`'; + $modifiedColumns[':p' . $index++] = 'REF'; } if ($this->isColumnModified(OrderTableMap::CUSTOMER_ID)) { - $modifiedColumns[':p' . $index++] = '`CUSTOMER_ID`'; + $modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; } if ($this->isColumnModified(OrderTableMap::INVOICE_ORDER_ADDRESS_ID)) { - $modifiedColumns[':p' . $index++] = '`INVOICE_ORDER_ADDRESS_ID`'; + $modifiedColumns[':p' . $index++] = 'INVOICE_ORDER_ADDRESS_ID'; } if ($this->isColumnModified(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID)) { - $modifiedColumns[':p' . $index++] = '`DELIVERY_ORDER_ADDRESS_ID`'; + $modifiedColumns[':p' . $index++] = 'DELIVERY_ORDER_ADDRESS_ID'; } if ($this->isColumnModified(OrderTableMap::INVOICE_DATE)) { - $modifiedColumns[':p' . $index++] = '`INVOICE_DATE`'; + $modifiedColumns[':p' . $index++] = 'INVOICE_DATE'; } if ($this->isColumnModified(OrderTableMap::CURRENCY_ID)) { - $modifiedColumns[':p' . $index++] = '`CURRENCY_ID`'; + $modifiedColumns[':p' . $index++] = 'CURRENCY_ID'; } if ($this->isColumnModified(OrderTableMap::CURRENCY_RATE)) { - $modifiedColumns[':p' . $index++] = '`CURRENCY_RATE`'; + $modifiedColumns[':p' . $index++] = 'CURRENCY_RATE'; } if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) { - $modifiedColumns[':p' . $index++] = '`TRANSACTION_REF`'; + $modifiedColumns[':p' . $index++] = 'TRANSACTION_REF'; } if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) { - $modifiedColumns[':p' . $index++] = '`DELIVERY_REF`'; + $modifiedColumns[':p' . $index++] = 'DELIVERY_REF'; } if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) { - $modifiedColumns[':p' . $index++] = '`INVOICE_REF`'; - } - if ($this->isColumnModified(OrderTableMap::DISCOUNT)) { - $modifiedColumns[':p' . $index++] = '`DISCOUNT`'; + $modifiedColumns[':p' . $index++] = 'INVOICE_REF'; } if ($this->isColumnModified(OrderTableMap::POSTAGE)) { - $modifiedColumns[':p' . $index++] = '`POSTAGE`'; + $modifiedColumns[':p' . $index++] = 'POSTAGE'; } if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) { - $modifiedColumns[':p' . $index++] = '`PAYMENT_MODULE_ID`'; + $modifiedColumns[':p' . $index++] = 'PAYMENT_MODULE_ID'; } if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) { - $modifiedColumns[':p' . $index++] = '`DELIVERY_MODULE_ID`'; + $modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID'; } if ($this->isColumnModified(OrderTableMap::STATUS_ID)) { - $modifiedColumns[':p' . $index++] = '`STATUS_ID`'; + $modifiedColumns[':p' . $index++] = 'STATUS_ID'; } if ($this->isColumnModified(OrderTableMap::LANG_ID)) { - $modifiedColumns[':p' . $index++] = '`LANG_ID`'; + $modifiedColumns[':p' . $index++] = 'LANG_ID'; } if ($this->isColumnModified(OrderTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order` (%s) VALUES (%s)', + 'INSERT INTO order (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1711,61 +1667,58 @@ abstract class Order implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`REF`': + case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`CUSTOMER_ID`': + case 'CUSTOMER_ID': $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); break; - case '`INVOICE_ORDER_ADDRESS_ID`': + case 'INVOICE_ORDER_ADDRESS_ID': $stmt->bindValue($identifier, $this->invoice_order_address_id, PDO::PARAM_INT); break; - case '`DELIVERY_ORDER_ADDRESS_ID`': + case 'DELIVERY_ORDER_ADDRESS_ID': $stmt->bindValue($identifier, $this->delivery_order_address_id, PDO::PARAM_INT); break; - case '`INVOICE_DATE`': + case 'INVOICE_DATE': $stmt->bindValue($identifier, $this->invoice_date ? $this->invoice_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); break; - case '`CURRENCY_ID`': + case 'CURRENCY_ID': $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT); break; - case '`CURRENCY_RATE`': + case 'CURRENCY_RATE': $stmt->bindValue($identifier, $this->currency_rate, PDO::PARAM_STR); break; - case '`TRANSACTION_REF`': + case 'TRANSACTION_REF': $stmt->bindValue($identifier, $this->transaction_ref, PDO::PARAM_STR); break; - case '`DELIVERY_REF`': + case 'DELIVERY_REF': $stmt->bindValue($identifier, $this->delivery_ref, PDO::PARAM_STR); break; - case '`INVOICE_REF`': + case 'INVOICE_REF': $stmt->bindValue($identifier, $this->invoice_ref, PDO::PARAM_STR); break; - case '`DISCOUNT`': - $stmt->bindValue($identifier, $this->discount, PDO::PARAM_STR); - break; - case '`POSTAGE`': + case 'POSTAGE': $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR); break; - case '`PAYMENT_MODULE_ID`': + case 'PAYMENT_MODULE_ID': $stmt->bindValue($identifier, $this->payment_module_id, PDO::PARAM_INT); break; - case '`DELIVERY_MODULE_ID`': + case 'DELIVERY_MODULE_ID': $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT); break; - case '`STATUS_ID`': + case 'STATUS_ID': $stmt->bindValue($identifier, $this->status_id, PDO::PARAM_INT); break; - case '`LANG_ID`': + case 'LANG_ID': $stmt->bindValue($identifier, $this->lang_id, PDO::PARAM_INT); 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); 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); break; } @@ -1864,27 +1817,24 @@ abstract class Order implements ActiveRecordInterface return $this->getInvoiceRef(); break; case 11: - return $this->getDiscount(); - break; - case 12: return $this->getPostage(); break; - case 13: + case 12: return $this->getPaymentModuleId(); break; - case 14: + case 13: return $this->getDeliveryModuleId(); break; - case 15: + case 14: return $this->getStatusId(); break; - case 16: + case 15: return $this->getLangId(); break; - case 17: + case 16: return $this->getCreatedAt(); break; - case 18: + case 17: return $this->getUpdatedAt(); break; default: @@ -1927,14 +1877,13 @@ abstract class Order implements ActiveRecordInterface $keys[8] => $this->getTransactionRef(), $keys[9] => $this->getDeliveryRef(), $keys[10] => $this->getInvoiceRef(), - $keys[11] => $this->getDiscount(), - $keys[12] => $this->getPostage(), - $keys[13] => $this->getPaymentModuleId(), - $keys[14] => $this->getDeliveryModuleId(), - $keys[15] => $this->getStatusId(), - $keys[16] => $this->getLangId(), - $keys[17] => $this->getCreatedAt(), - $keys[18] => $this->getUpdatedAt(), + $keys[11] => $this->getPostage(), + $keys[12] => $this->getPaymentModuleId(), + $keys[13] => $this->getDeliveryModuleId(), + $keys[14] => $this->getStatusId(), + $keys[15] => $this->getLangId(), + $keys[16] => $this->getCreatedAt(), + $keys[17] => $this->getUpdatedAt(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1969,8 +1918,8 @@ abstract class Order implements ActiveRecordInterface if (null !== $this->collOrderProducts) { $result['OrderProducts'] = $this->collOrderProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } - if (null !== $this->collOrderCoupons) { - $result['OrderCoupons'] = $this->collOrderCoupons->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + if (null !== $this->collCouponOrders) { + $result['CouponOrders'] = $this->collCouponOrders->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } @@ -2040,27 +1989,24 @@ abstract class Order implements ActiveRecordInterface $this->setInvoiceRef($value); break; case 11: - $this->setDiscount($value); - break; - case 12: $this->setPostage($value); break; - case 13: + case 12: $this->setPaymentModuleId($value); break; - case 14: + case 13: $this->setDeliveryModuleId($value); break; - case 15: + case 14: $this->setStatusId($value); break; - case 16: + case 15: $this->setLangId($value); break; - case 17: + case 16: $this->setCreatedAt($value); break; - case 18: + case 17: $this->setUpdatedAt($value); break; } // switch() @@ -2098,14 +2044,13 @@ abstract class Order implements ActiveRecordInterface if (array_key_exists($keys[8], $arr)) $this->setTransactionRef($arr[$keys[8]]); if (array_key_exists($keys[9], $arr)) $this->setDeliveryRef($arr[$keys[9]]); if (array_key_exists($keys[10], $arr)) $this->setInvoiceRef($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDiscount($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setPostage($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setPaymentModuleId($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setDeliveryModuleId($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setStatusId($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setLangId($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setCreatedAt($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setUpdatedAt($arr[$keys[18]]); + if (array_key_exists($keys[11], $arr)) $this->setPostage($arr[$keys[11]]); + if (array_key_exists($keys[12], $arr)) $this->setPaymentModuleId($arr[$keys[12]]); + if (array_key_exists($keys[13], $arr)) $this->setDeliveryModuleId($arr[$keys[13]]); + if (array_key_exists($keys[14], $arr)) $this->setStatusId($arr[$keys[14]]); + if (array_key_exists($keys[15], $arr)) $this->setLangId($arr[$keys[15]]); + if (array_key_exists($keys[16], $arr)) $this->setCreatedAt($arr[$keys[16]]); + if (array_key_exists($keys[17], $arr)) $this->setUpdatedAt($arr[$keys[17]]); } /** @@ -2128,7 +2073,6 @@ abstract class Order implements ActiveRecordInterface if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) $criteria->add(OrderTableMap::TRANSACTION_REF, $this->transaction_ref); if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) $criteria->add(OrderTableMap::DELIVERY_REF, $this->delivery_ref); if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) $criteria->add(OrderTableMap::INVOICE_REF, $this->invoice_ref); - if ($this->isColumnModified(OrderTableMap::DISCOUNT)) $criteria->add(OrderTableMap::DISCOUNT, $this->discount); if ($this->isColumnModified(OrderTableMap::POSTAGE)) $criteria->add(OrderTableMap::POSTAGE, $this->postage); if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) $criteria->add(OrderTableMap::PAYMENT_MODULE_ID, $this->payment_module_id); if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) $criteria->add(OrderTableMap::DELIVERY_MODULE_ID, $this->delivery_module_id); @@ -2209,7 +2153,6 @@ abstract class Order implements ActiveRecordInterface $copyObj->setTransactionRef($this->getTransactionRef()); $copyObj->setDeliveryRef($this->getDeliveryRef()); $copyObj->setInvoiceRef($this->getInvoiceRef()); - $copyObj->setDiscount($this->getDiscount()); $copyObj->setPostage($this->getPostage()); $copyObj->setPaymentModuleId($this->getPaymentModuleId()); $copyObj->setDeliveryModuleId($this->getDeliveryModuleId()); @@ -2229,9 +2172,9 @@ abstract class Order implements ActiveRecordInterface } } - foreach ($this->getOrderCoupons() as $relObj) { + foreach ($this->getCouponOrders() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addOrderCoupon($relObj->copy($deepCopy)); + $copyObj->addCouponOrder($relObj->copy($deepCopy)); } } @@ -2687,8 +2630,8 @@ abstract class Order implements ActiveRecordInterface if ('OrderProduct' == $relationName) { return $this->initOrderProducts(); } - if ('OrderCoupon' == $relationName) { - return $this->initOrderCoupons(); + if ('CouponOrder' == $relationName) { + return $this->initCouponOrders(); } } @@ -2911,31 +2854,31 @@ abstract class Order implements ActiveRecordInterface } /** - * Clears out the collOrderCoupons collection + * Clears out the collCouponOrders collection * * This does not modify the database; however, it will remove any associated objects, causing * them to be refetched by subsequent calls to accessor method. * * @return void - * @see addOrderCoupons() + * @see addCouponOrders() */ - public function clearOrderCoupons() + public function clearCouponOrders() { - $this->collOrderCoupons = null; // important to set this to NULL since that means it is uninitialized + $this->collCouponOrders = null; // important to set this to NULL since that means it is uninitialized } /** - * Reset is the collOrderCoupons collection loaded partially. + * Reset is the collCouponOrders collection loaded partially. */ - public function resetPartialOrderCoupons($v = true) + public function resetPartialCouponOrders($v = true) { - $this->collOrderCouponsPartial = $v; + $this->collCouponOrdersPartial = $v; } /** - * Initializes the collOrderCoupons collection. + * Initializes the collCouponOrders collection. * - * By default this just sets the collOrderCoupons collection to an empty array (like clearcollOrderCoupons()); + * By default this just sets the collCouponOrders collection to an empty array (like clearcollCouponOrders()); * however, you may wish to override this method in your stub class to provide setting appropriate * to your application -- for example, setting the initial array to the values stored in database. * @@ -2944,17 +2887,17 @@ abstract class Order implements ActiveRecordInterface * * @return void */ - public function initOrderCoupons($overrideExisting = true) + public function initCouponOrders($overrideExisting = true) { - if (null !== $this->collOrderCoupons && !$overrideExisting) { + if (null !== $this->collCouponOrders && !$overrideExisting) { return; } - $this->collOrderCoupons = new ObjectCollection(); - $this->collOrderCoupons->setModel('\Thelia\Model\OrderCoupon'); + $this->collCouponOrders = new ObjectCollection(); + $this->collCouponOrders->setModel('\Thelia\Model\CouponOrder'); } /** - * Gets an array of ChildOrderCoupon objects which contain a foreign key that references this object. + * Gets an array of ChildCouponOrder objects which contain a foreign key that references this object. * * If the $criteria is not null, it is used to always fetch the results from the database. * Otherwise the results are fetched from the database the first time, then cached. @@ -2964,109 +2907,109 @@ abstract class Order implements ActiveRecordInterface * * @param Criteria $criteria optional Criteria object to narrow the query * @param ConnectionInterface $con optional connection object - * @return Collection|ChildOrderCoupon[] List of ChildOrderCoupon objects + * @return Collection|ChildCouponOrder[] List of ChildCouponOrder objects * @throws PropelException */ - public function getOrderCoupons($criteria = null, ConnectionInterface $con = null) + public function getCouponOrders($criteria = null, ConnectionInterface $con = null) { - $partial = $this->collOrderCouponsPartial && !$this->isNew(); - if (null === $this->collOrderCoupons || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrderCoupons) { + $partial = $this->collCouponOrdersPartial && !$this->isNew(); + if (null === $this->collCouponOrders || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCouponOrders) { // return empty collection - $this->initOrderCoupons(); + $this->initCouponOrders(); } else { - $collOrderCoupons = ChildOrderCouponQuery::create(null, $criteria) + $collCouponOrders = ChildCouponOrderQuery::create(null, $criteria) ->filterByOrder($this) ->find($con); if (null !== $criteria) { - if (false !== $this->collOrderCouponsPartial && count($collOrderCoupons)) { - $this->initOrderCoupons(false); + if (false !== $this->collCouponOrdersPartial && count($collCouponOrders)) { + $this->initCouponOrders(false); - foreach ($collOrderCoupons as $obj) { - if (false == $this->collOrderCoupons->contains($obj)) { - $this->collOrderCoupons->append($obj); + foreach ($collCouponOrders as $obj) { + if (false == $this->collCouponOrders->contains($obj)) { + $this->collCouponOrders->append($obj); } } - $this->collOrderCouponsPartial = true; + $this->collCouponOrdersPartial = true; } - $collOrderCoupons->getInternalIterator()->rewind(); + $collCouponOrders->getInternalIterator()->rewind(); - return $collOrderCoupons; + return $collCouponOrders; } - if ($partial && $this->collOrderCoupons) { - foreach ($this->collOrderCoupons as $obj) { + if ($partial && $this->collCouponOrders) { + foreach ($this->collCouponOrders as $obj) { if ($obj->isNew()) { - $collOrderCoupons[] = $obj; + $collCouponOrders[] = $obj; } } } - $this->collOrderCoupons = $collOrderCoupons; - $this->collOrderCouponsPartial = false; + $this->collCouponOrders = $collCouponOrders; + $this->collCouponOrdersPartial = false; } } - return $this->collOrderCoupons; + return $this->collCouponOrders; } /** - * Sets a collection of OrderCoupon objects related by a one-to-many relationship + * Sets a collection of CouponOrder objects related by a one-to-many relationship * to the current object. * It will also schedule objects for deletion based on a diff between old objects (aka persisted) * and new objects from the given Propel collection. * - * @param Collection $orderCoupons A Propel collection. + * @param Collection $couponOrders A Propel collection. * @param ConnectionInterface $con Optional connection object * @return ChildOrder The current object (for fluent API support) */ - public function setOrderCoupons(Collection $orderCoupons, ConnectionInterface $con = null) + public function setCouponOrders(Collection $couponOrders, ConnectionInterface $con = null) { - $orderCouponsToDelete = $this->getOrderCoupons(new Criteria(), $con)->diff($orderCoupons); + $couponOrdersToDelete = $this->getCouponOrders(new Criteria(), $con)->diff($couponOrders); - $this->orderCouponsScheduledForDeletion = $orderCouponsToDelete; + $this->couponOrdersScheduledForDeletion = $couponOrdersToDelete; - foreach ($orderCouponsToDelete as $orderCouponRemoved) { - $orderCouponRemoved->setOrder(null); + foreach ($couponOrdersToDelete as $couponOrderRemoved) { + $couponOrderRemoved->setOrder(null); } - $this->collOrderCoupons = null; - foreach ($orderCoupons as $orderCoupon) { - $this->addOrderCoupon($orderCoupon); + $this->collCouponOrders = null; + foreach ($couponOrders as $couponOrder) { + $this->addCouponOrder($couponOrder); } - $this->collOrderCoupons = $orderCoupons; - $this->collOrderCouponsPartial = false; + $this->collCouponOrders = $couponOrders; + $this->collCouponOrdersPartial = false; return $this; } /** - * Returns the number of related OrderCoupon objects. + * Returns the number of related CouponOrder objects. * * @param Criteria $criteria * @param boolean $distinct * @param ConnectionInterface $con - * @return int Count of related OrderCoupon objects. + * @return int Count of related CouponOrder objects. * @throws PropelException */ - public function countOrderCoupons(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) + public function countCouponOrders(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { - $partial = $this->collOrderCouponsPartial && !$this->isNew(); - if (null === $this->collOrderCoupons || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collOrderCoupons) { + $partial = $this->collCouponOrdersPartial && !$this->isNew(); + if (null === $this->collCouponOrders || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCouponOrders) { return 0; } if ($partial && !$criteria) { - return count($this->getOrderCoupons()); + return count($this->getCouponOrders()); } - $query = ChildOrderCouponQuery::create(null, $criteria); + $query = ChildCouponOrderQuery::create(null, $criteria); if ($distinct) { $query->distinct(); } @@ -3076,53 +3019,53 @@ abstract class Order implements ActiveRecordInterface ->count($con); } - return count($this->collOrderCoupons); + return count($this->collCouponOrders); } /** - * Method called to associate a ChildOrderCoupon object to this object - * through the ChildOrderCoupon foreign key attribute. + * Method called to associate a ChildCouponOrder object to this object + * through the ChildCouponOrder foreign key attribute. * - * @param ChildOrderCoupon $l ChildOrderCoupon + * @param ChildCouponOrder $l ChildCouponOrder * @return \Thelia\Model\Order The current object (for fluent API support) */ - public function addOrderCoupon(ChildOrderCoupon $l) + public function addCouponOrder(ChildCouponOrder $l) { - if ($this->collOrderCoupons === null) { - $this->initOrderCoupons(); - $this->collOrderCouponsPartial = true; + if ($this->collCouponOrders === null) { + $this->initCouponOrders(); + $this->collCouponOrdersPartial = true; } - if (!in_array($l, $this->collOrderCoupons->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddOrderCoupon($l); + if (!in_array($l, $this->collCouponOrders->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddCouponOrder($l); } return $this; } /** - * @param OrderCoupon $orderCoupon The orderCoupon object to add. + * @param CouponOrder $couponOrder The couponOrder object to add. */ - protected function doAddOrderCoupon($orderCoupon) + protected function doAddCouponOrder($couponOrder) { - $this->collOrderCoupons[]= $orderCoupon; - $orderCoupon->setOrder($this); + $this->collCouponOrders[]= $couponOrder; + $couponOrder->setOrder($this); } /** - * @param OrderCoupon $orderCoupon The orderCoupon object to remove. + * @param CouponOrder $couponOrder The couponOrder object to remove. * @return ChildOrder The current object (for fluent API support) */ - public function removeOrderCoupon($orderCoupon) + public function removeCouponOrder($couponOrder) { - if ($this->getOrderCoupons()->contains($orderCoupon)) { - $this->collOrderCoupons->remove($this->collOrderCoupons->search($orderCoupon)); - if (null === $this->orderCouponsScheduledForDeletion) { - $this->orderCouponsScheduledForDeletion = clone $this->collOrderCoupons; - $this->orderCouponsScheduledForDeletion->clear(); + if ($this->getCouponOrders()->contains($couponOrder)) { + $this->collCouponOrders->remove($this->collCouponOrders->search($couponOrder)); + if (null === $this->couponOrdersScheduledForDeletion) { + $this->couponOrdersScheduledForDeletion = clone $this->collCouponOrders; + $this->couponOrdersScheduledForDeletion->clear(); } - $this->orderCouponsScheduledForDeletion[]= clone $orderCoupon; - $orderCoupon->setOrder(null); + $this->couponOrdersScheduledForDeletion[]= clone $couponOrder; + $couponOrder->setOrder(null); } return $this; @@ -3144,7 +3087,6 @@ abstract class Order implements ActiveRecordInterface $this->transaction_ref = null; $this->delivery_ref = null; $this->invoice_ref = null; - $this->discount = null; $this->postage = null; $this->payment_module_id = null; $this->delivery_module_id = null; @@ -3176,8 +3118,8 @@ abstract class Order implements ActiveRecordInterface $o->clearAllReferences($deep); } } - if ($this->collOrderCoupons) { - foreach ($this->collOrderCoupons as $o) { + if ($this->collCouponOrders) { + foreach ($this->collCouponOrders as $o) { $o->clearAllReferences($deep); } } @@ -3187,10 +3129,10 @@ abstract class Order implements ActiveRecordInterface $this->collOrderProducts->clearIterator(); } $this->collOrderProducts = null; - if ($this->collOrderCoupons instanceof Collection) { - $this->collOrderCoupons->clearIterator(); + if ($this->collCouponOrders instanceof Collection) { + $this->collCouponOrders->clearIterator(); } - $this->collOrderCoupons = null; + $this->collCouponOrders = null; $this->aCurrency = null; $this->aCustomer = null; $this->aOrderAddressRelatedByInvoiceOrderAddressId = null; diff --git a/core/lib/Thelia/Model/Base/OrderAddress.php b/core/lib/Thelia/Model/Base/OrderAddress.php index b04e302f7..d52fd9de3 100644 --- a/core/lib/Thelia/Model/Base/OrderAddress.php +++ b/core/lib/Thelia/Model/Base/OrderAddress.php @@ -1248,50 +1248,50 @@ abstract class OrderAddress implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderAddressTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderAddressTableMap::CUSTOMER_TITLE_ID)) { - $modifiedColumns[':p' . $index++] = '`CUSTOMER_TITLE_ID`'; + $modifiedColumns[':p' . $index++] = 'CUSTOMER_TITLE_ID'; } if ($this->isColumnModified(OrderAddressTableMap::COMPANY)) { - $modifiedColumns[':p' . $index++] = '`COMPANY`'; + $modifiedColumns[':p' . $index++] = 'COMPANY'; } if ($this->isColumnModified(OrderAddressTableMap::FIRSTNAME)) { - $modifiedColumns[':p' . $index++] = '`FIRSTNAME`'; + $modifiedColumns[':p' . $index++] = 'FIRSTNAME'; } if ($this->isColumnModified(OrderAddressTableMap::LASTNAME)) { - $modifiedColumns[':p' . $index++] = '`LASTNAME`'; + $modifiedColumns[':p' . $index++] = 'LASTNAME'; } if ($this->isColumnModified(OrderAddressTableMap::ADDRESS1)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS1`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS1'; } if ($this->isColumnModified(OrderAddressTableMap::ADDRESS2)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS2`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS2'; } if ($this->isColumnModified(OrderAddressTableMap::ADDRESS3)) { - $modifiedColumns[':p' . $index++] = '`ADDRESS3`'; + $modifiedColumns[':p' . $index++] = 'ADDRESS3'; } if ($this->isColumnModified(OrderAddressTableMap::ZIPCODE)) { - $modifiedColumns[':p' . $index++] = '`ZIPCODE`'; + $modifiedColumns[':p' . $index++] = 'ZIPCODE'; } if ($this->isColumnModified(OrderAddressTableMap::CITY)) { - $modifiedColumns[':p' . $index++] = '`CITY`'; + $modifiedColumns[':p' . $index++] = 'CITY'; } if ($this->isColumnModified(OrderAddressTableMap::PHONE)) { - $modifiedColumns[':p' . $index++] = '`PHONE`'; + $modifiedColumns[':p' . $index++] = 'PHONE'; } if ($this->isColumnModified(OrderAddressTableMap::COUNTRY_ID)) { - $modifiedColumns[':p' . $index++] = '`COUNTRY_ID`'; + $modifiedColumns[':p' . $index++] = 'COUNTRY_ID'; } if ($this->isColumnModified(OrderAddressTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderAddressTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_address` (%s) VALUES (%s)', + 'INSERT INTO order_address (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1300,46 +1300,46 @@ abstract class OrderAddress implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CUSTOMER_TITLE_ID`': + case 'CUSTOMER_TITLE_ID': $stmt->bindValue($identifier, $this->customer_title_id, PDO::PARAM_INT); break; - case '`COMPANY`': + case 'COMPANY': $stmt->bindValue($identifier, $this->company, PDO::PARAM_STR); break; - case '`FIRSTNAME`': + case 'FIRSTNAME': $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR); break; - case '`LASTNAME`': + case 'LASTNAME': $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR); break; - case '`ADDRESS1`': + case 'ADDRESS1': $stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR); break; - case '`ADDRESS2`': + case 'ADDRESS2': $stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR); break; - case '`ADDRESS3`': + case 'ADDRESS3': $stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR); break; - case '`ZIPCODE`': + case 'ZIPCODE': $stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR); break; - case '`CITY`': + case 'CITY': $stmt->bindValue($identifier, $this->city, PDO::PARAM_STR); break; - case '`PHONE`': + case 'PHONE': $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR); break; - case '`COUNTRY_ID`': + case 'COUNTRY_ID': $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/OrderAddressQuery.php b/core/lib/Thelia/Model/Base/OrderAddressQuery.php index 575e24338..41f417872 100644 --- a/core/lib/Thelia/Model/Base/OrderAddressQuery.php +++ b/core/lib/Thelia/Model/Base/OrderAddressQuery.php @@ -183,7 +183,7 @@ abstract class OrderAddressQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CUSTOMER_TITLE_ID`, `COMPANY`, `FIRSTNAME`, `LASTNAME`, `ADDRESS1`, `ADDRESS2`, `ADDRESS3`, `ZIPCODE`, `CITY`, `PHONE`, `COUNTRY_ID`, `CREATED_AT`, `UPDATED_AT` FROM `order_address` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CUSTOMER_TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, PHONE, COUNTRY_ID, CREATED_AT, UPDATED_AT FROM order_address WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderCouponQuery.php b/core/lib/Thelia/Model/Base/OrderCouponQuery.php deleted file mode 100644 index 037a8f695..000000000 --- a/core/lib/Thelia/Model/Base/OrderCouponQuery.php +++ /dev/null @@ -1,1016 +0,0 @@ -setModelAlias($modelAlias); - } - if ($criteria instanceof Criteria) { - $query->mergeWith($criteria); - } - - return $query; - } - - /** - * Find object by primary key. - * Propel uses the instance pool to skip the database if the object exists. - * Go fast if the query is untouched. - * - * - * $obj = $c->findPk(12, $con); - * - * - * @param mixed $key Primary key to use for the query - * @param ConnectionInterface $con an optional connection object - * - * @return ChildOrderCoupon|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = OrderCouponTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getServiceContainer()->getReadConnection(OrderCouponTableMap::DATABASE_NAME); - } - $this->basePreSelect($con); - if ($this->formatter || $this->modelAlias || $this->with || $this->select - || $this->selectColumns || $this->asColumns || $this->selectModifiers - || $this->map || $this->having || $this->joins) { - return $this->findPkComplex($key, $con); - } else { - return $this->findPkSimple($key, $con); - } - } - - /** - * Find object by primary key using raw SQL to go fast. - * Bypass doSelect() and the object formatter by using generated code. - * - * @param mixed $key Primary key to use for the query - * @param ConnectionInterface $con A connection object - * - * @return ChildOrderCoupon A model object, or null if the key is not found - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `ID`, `ORDER_ID`, `CODE`, `TYPE`, `AMOUNT`, `TITLE`, `SHORT_DESCRIPTION`, `DESCRIPTION`, `EXPIRATION_DATE`, `IS_CUMULATIVE`, `IS_REMOVING_POSTAGE`, `IS_AVAILABLE_ON_SPECIAL_OFFERS`, `SERIALIZED_CONDITIONS`, `CREATED_AT`, `UPDATED_AT` FROM `order_coupon` WHERE `ID` = :p0'; - try { - $stmt = $con->prepare($sql); - $stmt->bindValue(':p0', $key, PDO::PARAM_INT); - $stmt->execute(); - } catch (Exception $e) { - Propel::log($e->getMessage(), Propel::LOG_ERR); - throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); - } - $obj = null; - if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { - $obj = new ChildOrderCoupon(); - $obj->hydrate($row); - OrderCouponTableMap::addInstanceToPool($obj, (string) $key); - } - $stmt->closeCursor(); - - return $obj; - } - - /** - * Find object by primary key. - * - * @param mixed $key Primary key to use for the query - * @param ConnectionInterface $con A connection object - * - * @return ChildOrderCoupon|array|mixed the result, formatted by the current formatter - */ - protected function findPkComplex($key, $con) - { - // As the query uses a PK condition, no limit(1) is necessary. - $criteria = $this->isKeepQuery() ? clone $this : $this; - $dataFetcher = $criteria - ->filterByPrimaryKey($key) - ->doSelect($con); - - return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher); - } - - /** - * Find objects by primary key - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @param array $keys Primary keys to use for the query - * @param ConnectionInterface $con an optional connection object - * - * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter - */ - public function findPks($keys, $con = null) - { - if (null === $con) { - $con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); - } - $this->basePreSelect($con); - $criteria = $this->isKeepQuery() ? clone $this : $this; - $dataFetcher = $criteria - ->filterByPrimaryKeys($keys) - ->doSelect($con); - - return $criteria->getFormatter()->init($criteria)->format($dataFetcher); - } - - /** - * Filter the query by primary key - * - * @param mixed $key Primary key to use for the query - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - - return $this->addUsingAlias(OrderCouponTableMap::ID, $key, Criteria::EQUAL); - } - - /** - * Filter the query by a list of primary keys - * - * @param array $keys The list of primary key to use for the query - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - - return $this->addUsingAlias(OrderCouponTableMap::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * Example usage: - * - * $query->filterById(1234); // WHERE id = 1234 - * $query->filterById(array(12, 34)); // WHERE id IN (12, 34) - * $query->filterById(array('min' => 12)); // WHERE id > 12 - * - * - * @param mixed $id The value to use as filter. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id)) { - $useMinMax = false; - if (isset($id['min'])) { - $this->addUsingAlias(OrderCouponTableMap::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(OrderCouponTableMap::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::ID, $id, $comparison); - } - - /** - * Filter the query on the order_id column - * - * Example usage: - * - * $query->filterByOrderId(1234); // WHERE order_id = 1234 - * $query->filterByOrderId(array(12, 34)); // WHERE order_id IN (12, 34) - * $query->filterByOrderId(array('min' => 12)); // WHERE order_id > 12 - * - * - * @see filterByOrder() - * - * @param mixed $orderId The value to use as filter. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByOrderId($orderId = null, $comparison = null) - { - if (is_array($orderId)) { - $useMinMax = false; - if (isset($orderId['min'])) { - $this->addUsingAlias(OrderCouponTableMap::ORDER_ID, $orderId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($orderId['max'])) { - $this->addUsingAlias(OrderCouponTableMap::ORDER_ID, $orderId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::ORDER_ID, $orderId, $comparison); - } - - /** - * Filter the query on the code column - * - * Example usage: - * - * $query->filterByCode('fooValue'); // WHERE code = 'fooValue' - * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%' - * - * - * @param string $code The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByCode($code = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($code)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $code)) { - $code = str_replace('*', '%', $code); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::CODE, $code, $comparison); - } - - /** - * Filter the query on the type column - * - * Example usage: - * - * $query->filterByType('fooValue'); // WHERE type = 'fooValue' - * $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%' - * - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::TYPE, $type, $comparison); - } - - /** - * Filter the query on the amount column - * - * Example usage: - * - * $query->filterByAmount(1234); // WHERE amount = 1234 - * $query->filterByAmount(array(12, 34)); // WHERE amount IN (12, 34) - * $query->filterByAmount(array('min' => 12)); // WHERE amount > 12 - * - * - * @param mixed $amount 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 ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByAmount($amount = null, $comparison = null) - { - if (is_array($amount)) { - $useMinMax = false; - if (isset($amount['min'])) { - $this->addUsingAlias(OrderCouponTableMap::AMOUNT, $amount['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($amount['max'])) { - $this->addUsingAlias(OrderCouponTableMap::AMOUNT, $amount['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::AMOUNT, $amount, $comparison); - } - - /** - * Filter the query on the title column - * - * Example usage: - * - * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue' - * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%' - * - * - * @param string $title The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByTitle($title = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($title)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $title)) { - $title = str_replace('*', '%', $title); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::TITLE, $title, $comparison); - } - - /** - * Filter the query on the short_description column - * - * Example usage: - * - * $query->filterByShortDescription('fooValue'); // WHERE short_description = 'fooValue' - * $query->filterByShortDescription('%fooValue%'); // WHERE short_description LIKE '%fooValue%' - * - * - * @param string $shortDescription The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByShortDescription($shortDescription = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($shortDescription)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $shortDescription)) { - $shortDescription = str_replace('*', '%', $shortDescription); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::SHORT_DESCRIPTION, $shortDescription, $comparison); - } - - /** - * Filter the query on the description column - * - * Example usage: - * - * $query->filterByDescription('fooValue'); // WHERE description = 'fooValue' - * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%' - * - * - * @param string $description The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByDescription($description = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($description)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $description)) { - $description = str_replace('*', '%', $description); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::DESCRIPTION, $description, $comparison); - } - - /** - * Filter the query on the expiration_date column - * - * Example usage: - * - * $query->filterByExpirationDate('2011-03-14'); // WHERE expiration_date = '2011-03-14' - * $query->filterByExpirationDate('now'); // WHERE expiration_date = '2011-03-14' - * $query->filterByExpirationDate(array('max' => 'yesterday')); // WHERE expiration_date > '2011-03-13' - * - * - * @param mixed $expirationDate The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByExpirationDate($expirationDate = null, $comparison = null) - { - if (is_array($expirationDate)) { - $useMinMax = false; - if (isset($expirationDate['min'])) { - $this->addUsingAlias(OrderCouponTableMap::EXPIRATION_DATE, $expirationDate['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($expirationDate['max'])) { - $this->addUsingAlias(OrderCouponTableMap::EXPIRATION_DATE, $expirationDate['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::EXPIRATION_DATE, $expirationDate, $comparison); - } - - /** - * Filter the query on the is_cumulative column - * - * Example usage: - * - * $query->filterByIsCumulative(true); // WHERE is_cumulative = true - * $query->filterByIsCumulative('yes'); // WHERE is_cumulative = true - * - * - * @param boolean|string $isCumulative The value to use as filter. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByIsCumulative($isCumulative = null, $comparison = null) - { - if (is_string($isCumulative)) { - $is_cumulative = in_array(strtolower($isCumulative), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } - - return $this->addUsingAlias(OrderCouponTableMap::IS_CUMULATIVE, $isCumulative, $comparison); - } - - /** - * Filter the query on the is_removing_postage column - * - * Example usage: - * - * $query->filterByIsRemovingPostage(true); // WHERE is_removing_postage = true - * $query->filterByIsRemovingPostage('yes'); // WHERE is_removing_postage = true - * - * - * @param boolean|string $isRemovingPostage The value to use as filter. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByIsRemovingPostage($isRemovingPostage = null, $comparison = null) - { - if (is_string($isRemovingPostage)) { - $is_removing_postage = in_array(strtolower($isRemovingPostage), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } - - return $this->addUsingAlias(OrderCouponTableMap::IS_REMOVING_POSTAGE, $isRemovingPostage, $comparison); - } - - /** - * Filter the query on the is_available_on_special_offers column - * - * Example usage: - * - * $query->filterByIsAvailableOnSpecialOffers(true); // WHERE is_available_on_special_offers = true - * $query->filterByIsAvailableOnSpecialOffers('yes'); // WHERE is_available_on_special_offers = true - * - * - * @param boolean|string $isAvailableOnSpecialOffers The value to use as filter. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByIsAvailableOnSpecialOffers($isAvailableOnSpecialOffers = null, $comparison = null) - { - if (is_string($isAvailableOnSpecialOffers)) { - $is_available_on_special_offers = in_array(strtolower($isAvailableOnSpecialOffers), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } - - return $this->addUsingAlias(OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS, $isAvailableOnSpecialOffers, $comparison); - } - - /** - * Filter the query on the serialized_conditions column - * - * Example usage: - * - * $query->filterBySerializedConditions('fooValue'); // WHERE serialized_conditions = 'fooValue' - * $query->filterBySerializedConditions('%fooValue%'); // WHERE serialized_conditions LIKE '%fooValue%' - * - * - * @param string $serializedConditions The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterBySerializedConditions($serializedConditions = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($serializedConditions)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $serializedConditions)) { - $serializedConditions = str_replace('*', '%', $serializedConditions); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::SERIALIZED_CONDITIONS, $serializedConditions, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(OrderCouponTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(OrderCouponTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(OrderCouponTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(OrderCouponTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderCouponTableMap::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query by a related \Thelia\Model\Order object - * - * @param \Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function filterByOrder($order, $comparison = null) - { - if ($order instanceof \Thelia\Model\Order) { - return $this - ->addUsingAlias(OrderCouponTableMap::ORDER_ID, $order->getId(), $comparison); - } elseif ($order instanceof ObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(OrderCouponTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection'); - } - } - - /** - * Adds a JOIN clause to the query using the Order relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Order'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Order'); - } - - return $this; - } - - /** - * Use the Order relation Order object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query - */ - public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinOrder($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery'); - } - - /** - * Exclude object from result - * - * @param ChildOrderCoupon $orderCoupon Object to remove from the list of results - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function prune($orderCoupon = null) - { - if ($orderCoupon) { - $this->addUsingAlias(OrderCouponTableMap::ID, $orderCoupon->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Deletes all rows from the order_coupon table. - * - * @param ConnectionInterface $con the connection to use - * @return int The number of affected rows (if supported by underlying database driver). - */ - public function doDeleteAll(ConnectionInterface $con = null) - { - if (null === $con) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); - } - $affectedRows = 0; // initialize var to track total num of affected rows - try { - // use transaction because $criteria could contain info - // for more than one table or we could emulating ON DELETE CASCADE, etc. - $con->beginTransaction(); - $affectedRows += parent::doDeleteAll($con); - // Because this db requires some delete cascade/set null emulation, we have to - // clear the cached instance *after* the emulation has happened (since - // instances get re-added by the select statement contained therein). - OrderCouponTableMap::clearInstancePool(); - OrderCouponTableMap::clearRelatedInstancePool(); - - $con->commit(); - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - - return $affectedRows; - } - - /** - * Performs a DELETE on the database, given a ChildOrderCoupon or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or ChildOrderCoupon object or primary key or array of primary keys - * which is used to create the DELETE statement - * @param ConnectionInterface $con the connection to use - * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows - * if supported by native driver or if emulated using Propel. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public function delete(ConnectionInterface $con = null) - { - if (null === $con) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); - } - - $criteria = $this; - - // Set the correct dbName - $criteria->setDbName(OrderCouponTableMap::DATABASE_NAME); - - $affectedRows = 0; // initialize var to track total num of affected rows - - try { - // use transaction because $criteria could contain info - // for more than one table or we could emulating ON DELETE CASCADE, etc. - $con->beginTransaction(); - - - OrderCouponTableMap::removeInstanceFromPool($criteria); - - $affectedRows += ModelCriteria::delete($con); - OrderCouponTableMap::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - // timestampable behavior - - /** - * Filter by the latest updated - * - * @param int $nbDays Maximum age of the latest update in days - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function recentlyUpdated($nbDays = 7) - { - return $this->addUsingAlias(OrderCouponTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Filter by the latest created - * - * @param int $nbDays Maximum age of in days - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function recentlyCreated($nbDays = 7) - { - return $this->addUsingAlias(OrderCouponTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by update date desc - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function lastUpdatedFirst() - { - return $this->addDescendingOrderByColumn(OrderCouponTableMap::UPDATED_AT); - } - - /** - * Order by update date asc - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function firstUpdatedFirst() - { - return $this->addAscendingOrderByColumn(OrderCouponTableMap::UPDATED_AT); - } - - /** - * Order by create date desc - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function lastCreatedFirst() - { - return $this->addDescendingOrderByColumn(OrderCouponTableMap::CREATED_AT); - } - - /** - * Order by create date asc - * - * @return ChildOrderCouponQuery The current query, for fluid interface - */ - public function firstCreatedFirst() - { - return $this->addAscendingOrderByColumn(OrderCouponTableMap::CREATED_AT); - } - -} // OrderCouponQuery diff --git a/core/lib/Thelia/Model/Base/OrderProduct.php b/core/lib/Thelia/Model/Base/OrderProduct.php index 1c7309b77..0cf8c80b6 100644 --- a/core/lib/Thelia/Model/Base/OrderProduct.php +++ b/core/lib/Thelia/Model/Base/OrderProduct.php @@ -1523,68 +1523,68 @@ abstract class OrderProduct implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderProductTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderProductTableMap::ORDER_ID)) { - $modifiedColumns[':p' . $index++] = '`ORDER_ID`'; + $modifiedColumns[':p' . $index++] = 'ORDER_ID'; } if ($this->isColumnModified(OrderProductTableMap::PRODUCT_REF)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_REF`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_REF'; } if ($this->isColumnModified(OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_SALE_ELEMENTS_REF`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_REF'; } if ($this->isColumnModified(OrderProductTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(OrderProductTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(OrderProductTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(OrderProductTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } if ($this->isColumnModified(OrderProductTableMap::QUANTITY)) { - $modifiedColumns[':p' . $index++] = '`QUANTITY`'; + $modifiedColumns[':p' . $index++] = 'QUANTITY'; } if ($this->isColumnModified(OrderProductTableMap::PRICE)) { - $modifiedColumns[':p' . $index++] = '`PRICE`'; + $modifiedColumns[':p' . $index++] = 'PRICE'; } if ($this->isColumnModified(OrderProductTableMap::PROMO_PRICE)) { - $modifiedColumns[':p' . $index++] = '`PROMO_PRICE`'; + $modifiedColumns[':p' . $index++] = 'PROMO_PRICE'; } if ($this->isColumnModified(OrderProductTableMap::WAS_NEW)) { - $modifiedColumns[':p' . $index++] = '`WAS_NEW`'; + $modifiedColumns[':p' . $index++] = 'WAS_NEW'; } if ($this->isColumnModified(OrderProductTableMap::WAS_IN_PROMO)) { - $modifiedColumns[':p' . $index++] = '`WAS_IN_PROMO`'; + $modifiedColumns[':p' . $index++] = 'WAS_IN_PROMO'; } if ($this->isColumnModified(OrderProductTableMap::WEIGHT)) { - $modifiedColumns[':p' . $index++] = '`WEIGHT`'; + $modifiedColumns[':p' . $index++] = 'WEIGHT'; } if ($this->isColumnModified(OrderProductTableMap::EAN_CODE)) { - $modifiedColumns[':p' . $index++] = '`EAN_CODE`'; + $modifiedColumns[':p' . $index++] = 'EAN_CODE'; } if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_TITLE)) { - $modifiedColumns[':p' . $index++] = '`TAX_RULE_TITLE`'; + $modifiedColumns[':p' . $index++] = 'TAX_RULE_TITLE'; } if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`TAX_RULE_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'TAX_RULE_DESCRIPTION'; } if ($this->isColumnModified(OrderProductTableMap::PARENT)) { - $modifiedColumns[':p' . $index++] = '`PARENT`'; + $modifiedColumns[':p' . $index++] = 'PARENT'; } if ($this->isColumnModified(OrderProductTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderProductTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_product` (%s) VALUES (%s)', + 'INSERT INTO order_product (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1593,64 +1593,64 @@ abstract class OrderProduct implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ORDER_ID`': + case 'ORDER_ID': $stmt->bindValue($identifier, $this->order_id, PDO::PARAM_INT); break; - case '`PRODUCT_REF`': + case 'PRODUCT_REF': $stmt->bindValue($identifier, $this->product_ref, PDO::PARAM_STR); break; - case '`PRODUCT_SALE_ELEMENTS_REF`': + case 'PRODUCT_SALE_ELEMENTS_REF': $stmt->bindValue($identifier, $this->product_sale_elements_ref, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; - case '`QUANTITY`': + case 'QUANTITY': $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR); break; - case '`PRICE`': + case 'PRICE': $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR); break; - case '`PROMO_PRICE`': + case 'PROMO_PRICE': $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR); break; - case '`WAS_NEW`': + case 'WAS_NEW': $stmt->bindValue($identifier, $this->was_new, PDO::PARAM_INT); break; - case '`WAS_IN_PROMO`': + case 'WAS_IN_PROMO': $stmt->bindValue($identifier, $this->was_in_promo, PDO::PARAM_INT); break; - case '`WEIGHT`': + case 'WEIGHT': $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR); break; - case '`EAN_CODE`': + case 'EAN_CODE': $stmt->bindValue($identifier, $this->ean_code, PDO::PARAM_STR); break; - case '`TAX_RULE_TITLE`': + case 'TAX_RULE_TITLE': $stmt->bindValue($identifier, $this->tax_rule_title, PDO::PARAM_STR); break; - case '`TAX_RULE_DESCRIPTION`': + case 'TAX_RULE_DESCRIPTION': $stmt->bindValue($identifier, $this->tax_rule_description, PDO::PARAM_STR); break; - case '`PARENT`': + case 'PARENT': $stmt->bindValue($identifier, $this->parent, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php b/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php index 79409f735..bcdcada7a 100644 --- a/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Model/Base/OrderProductAttributeCombination.php @@ -1128,44 +1128,44 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ORDER_PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`ORDER_PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'ORDER_PRODUCT_ID'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_TITLE)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_TITLE`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_TITLE'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_CHAPO)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_CHAPO`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_CHAPO'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_DESCRIPTION'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_POSTSCRIPTUM'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_TITLE)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_AV_TITLE`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_TITLE'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_CHAPO)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_AV_CHAPO`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_CHAPO'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_AV_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_DESCRIPTION'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::ATTRIBUTE_AV_POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`ATTRIBUTE_AV_POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'ATTRIBUTE_AV_POSTSCRIPTUM'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderProductAttributeCombinationTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_product_attribute_combination` (%s) VALUES (%s)', + 'INSERT INTO order_product_attribute_combination (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1174,40 +1174,40 @@ abstract class OrderProductAttributeCombination implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ORDER_PRODUCT_ID`': + case 'ORDER_PRODUCT_ID': $stmt->bindValue($identifier, $this->order_product_id, PDO::PARAM_INT); break; - case '`ATTRIBUTE_TITLE`': + case 'ATTRIBUTE_TITLE': $stmt->bindValue($identifier, $this->attribute_title, PDO::PARAM_STR); break; - case '`ATTRIBUTE_CHAPO`': + case 'ATTRIBUTE_CHAPO': $stmt->bindValue($identifier, $this->attribute_chapo, PDO::PARAM_STR); break; - case '`ATTRIBUTE_DESCRIPTION`': + case 'ATTRIBUTE_DESCRIPTION': $stmt->bindValue($identifier, $this->attribute_description, PDO::PARAM_STR); break; - case '`ATTRIBUTE_POSTSCRIPTUM`': + case 'ATTRIBUTE_POSTSCRIPTUM': $stmt->bindValue($identifier, $this->attribute_postscriptum, PDO::PARAM_STR); break; - case '`ATTRIBUTE_AV_TITLE`': + case 'ATTRIBUTE_AV_TITLE': $stmt->bindValue($identifier, $this->attribute_av_title, PDO::PARAM_STR); break; - case '`ATTRIBUTE_AV_CHAPO`': + case 'ATTRIBUTE_AV_CHAPO': $stmt->bindValue($identifier, $this->attribute_av_chapo, PDO::PARAM_STR); break; - case '`ATTRIBUTE_AV_DESCRIPTION`': + case 'ATTRIBUTE_AV_DESCRIPTION': $stmt->bindValue($identifier, $this->attribute_av_description, PDO::PARAM_STR); break; - case '`ATTRIBUTE_AV_POSTSCRIPTUM`': + case 'ATTRIBUTE_AV_POSTSCRIPTUM': $stmt->bindValue($identifier, $this->attribute_av_postscriptum, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php b/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php index cddfb5bbc..886b75c5f 100644 --- a/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php +++ b/core/lib/Thelia/Model/Base/OrderProductAttributeCombinationQuery.php @@ -171,7 +171,7 @@ abstract class OrderProductAttributeCombinationQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `ORDER_PRODUCT_ID`, `ATTRIBUTE_TITLE`, `ATTRIBUTE_CHAPO`, `ATTRIBUTE_DESCRIPTION`, `ATTRIBUTE_POSTSCRIPTUM`, `ATTRIBUTE_AV_TITLE`, `ATTRIBUTE_AV_CHAPO`, `ATTRIBUTE_AV_DESCRIPTION`, `ATTRIBUTE_AV_POSTSCRIPTUM`, `CREATED_AT`, `UPDATED_AT` FROM `order_product_attribute_combination` WHERE `ID` = :p0'; + $sql = 'SELECT ID, ORDER_PRODUCT_ID, ATTRIBUTE_TITLE, ATTRIBUTE_CHAPO, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_POSTSCRIPTUM, ATTRIBUTE_AV_TITLE, ATTRIBUTE_AV_CHAPO, ATTRIBUTE_AV_DESCRIPTION, ATTRIBUTE_AV_POSTSCRIPTUM, CREATED_AT, UPDATED_AT FROM order_product_attribute_combination WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderProductQuery.php b/core/lib/Thelia/Model/Base/OrderProductQuery.php index 4ab5d4721..4bf32e83d 100644 --- a/core/lib/Thelia/Model/Base/OrderProductQuery.php +++ b/core/lib/Thelia/Model/Base/OrderProductQuery.php @@ -211,7 +211,7 @@ abstract class OrderProductQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `ORDER_ID`, `PRODUCT_REF`, `PRODUCT_SALE_ELEMENTS_REF`, `TITLE`, `CHAPO`, `DESCRIPTION`, `POSTSCRIPTUM`, `QUANTITY`, `PRICE`, `PROMO_PRICE`, `WAS_NEW`, `WAS_IN_PROMO`, `WEIGHT`, `EAN_CODE`, `TAX_RULE_TITLE`, `TAX_RULE_DESCRIPTION`, `PARENT`, `CREATED_AT`, `UPDATED_AT` FROM `order_product` WHERE `ID` = :p0'; + $sql = 'SELECT ID, ORDER_ID, PRODUCT_REF, PRODUCT_SALE_ELEMENTS_REF, TITLE, CHAPO, DESCRIPTION, POSTSCRIPTUM, QUANTITY, PRICE, PROMO_PRICE, WAS_NEW, WAS_IN_PROMO, WEIGHT, EAN_CODE, TAX_RULE_TITLE, TAX_RULE_DESCRIPTION, PARENT, CREATED_AT, UPDATED_AT FROM order_product WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderProductTax.php b/core/lib/Thelia/Model/Base/OrderProductTax.php index f60c85bc8..91d3492e1 100644 --- a/core/lib/Thelia/Model/Base/OrderProductTax.php +++ b/core/lib/Thelia/Model/Base/OrderProductTax.php @@ -964,32 +964,32 @@ abstract class OrderProductTax implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderProductTaxTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderProductTaxTableMap::ORDER_PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`ORDER_PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'ORDER_PRODUCT_ID'; } if ($this->isColumnModified(OrderProductTaxTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(OrderProductTaxTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(OrderProductTaxTableMap::AMOUNT)) { - $modifiedColumns[':p' . $index++] = '`AMOUNT`'; + $modifiedColumns[':p' . $index++] = 'AMOUNT'; } if ($this->isColumnModified(OrderProductTaxTableMap::PROMO_AMOUNT)) { - $modifiedColumns[':p' . $index++] = '`PROMO_AMOUNT`'; + $modifiedColumns[':p' . $index++] = 'PROMO_AMOUNT'; } if ($this->isColumnModified(OrderProductTaxTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderProductTaxTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_product_tax` (%s) VALUES (%s)', + 'INSERT INTO order_product_tax (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -998,28 +998,28 @@ abstract class OrderProductTax implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`ORDER_PRODUCT_ID`': + case 'ORDER_PRODUCT_ID': $stmt->bindValue($identifier, $this->order_product_id, PDO::PARAM_INT); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`AMOUNT`': + case 'AMOUNT': $stmt->bindValue($identifier, $this->amount, PDO::PARAM_STR); break; - case '`PROMO_AMOUNT`': + case 'PROMO_AMOUNT': $stmt->bindValue($identifier, $this->promo_amount, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php b/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php index 4bb59bf0d..d0153d0cd 100644 --- a/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php +++ b/core/lib/Thelia/Model/Base/OrderProductTaxQuery.php @@ -155,7 +155,7 @@ abstract class OrderProductTaxQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `ORDER_PRODUCT_ID`, `TITLE`, `DESCRIPTION`, `AMOUNT`, `PROMO_AMOUNT`, `CREATED_AT`, `UPDATED_AT` FROM `order_product_tax` WHERE `ID` = :p0'; + $sql = 'SELECT ID, ORDER_PRODUCT_ID, TITLE, DESCRIPTION, AMOUNT, PROMO_AMOUNT, CREATED_AT, UPDATED_AT FROM order_product_tax WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderQuery.php b/core/lib/Thelia/Model/Base/OrderQuery.php index 96aa3d30b..592864f1f 100644 --- a/core/lib/Thelia/Model/Base/OrderQuery.php +++ b/core/lib/Thelia/Model/Base/OrderQuery.php @@ -32,7 +32,6 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrderQuery orderByTransactionRef($order = Criteria::ASC) Order by the transaction_ref column * @method ChildOrderQuery orderByDeliveryRef($order = Criteria::ASC) Order by the delivery_ref column * @method ChildOrderQuery orderByInvoiceRef($order = Criteria::ASC) Order by the invoice_ref column - * @method ChildOrderQuery orderByDiscount($order = Criteria::ASC) Order by the discount column * @method ChildOrderQuery orderByPostage($order = Criteria::ASC) Order by the postage column * @method ChildOrderQuery orderByPaymentModuleId($order = Criteria::ASC) Order by the payment_module_id column * @method ChildOrderQuery orderByDeliveryModuleId($order = Criteria::ASC) Order by the delivery_module_id column @@ -52,7 +51,6 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrderQuery groupByTransactionRef() Group by the transaction_ref column * @method ChildOrderQuery groupByDeliveryRef() Group by the delivery_ref column * @method ChildOrderQuery groupByInvoiceRef() Group by the invoice_ref column - * @method ChildOrderQuery groupByDiscount() Group by the discount column * @method ChildOrderQuery groupByPostage() Group by the postage column * @method ChildOrderQuery groupByPaymentModuleId() Group by the payment_module_id column * @method ChildOrderQuery groupByDeliveryModuleId() Group by the delivery_module_id column @@ -101,9 +99,9 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrderQuery rightJoinOrderProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderProduct relation * @method ChildOrderQuery innerJoinOrderProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderProduct relation * - * @method ChildOrderQuery leftJoinOrderCoupon($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderCoupon relation - * @method ChildOrderQuery rightJoinOrderCoupon($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderCoupon relation - * @method ChildOrderQuery innerJoinOrderCoupon($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderCoupon relation + * @method ChildOrderQuery leftJoinCouponOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the CouponOrder relation + * @method ChildOrderQuery rightJoinCouponOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CouponOrder relation + * @method ChildOrderQuery innerJoinCouponOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the CouponOrder relation * * @method ChildOrder findOne(ConnectionInterface $con = null) Return the first ChildOrder matching the query * @method ChildOrder findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrder matching the query, or a new ChildOrder object populated from the query conditions when no match is found @@ -119,7 +117,6 @@ use Thelia\Model\Map\OrderTableMap; * @method ChildOrder findOneByTransactionRef(string $transaction_ref) Return the first ChildOrder filtered by the transaction_ref column * @method ChildOrder findOneByDeliveryRef(string $delivery_ref) Return the first ChildOrder filtered by the delivery_ref column * @method ChildOrder findOneByInvoiceRef(string $invoice_ref) Return the first ChildOrder filtered by the invoice_ref column - * @method ChildOrder findOneByDiscount(double $discount) Return the first ChildOrder filtered by the discount column * @method ChildOrder findOneByPostage(double $postage) Return the first ChildOrder filtered by the postage column * @method ChildOrder findOneByPaymentModuleId(int $payment_module_id) Return the first ChildOrder filtered by the payment_module_id column * @method ChildOrder findOneByDeliveryModuleId(int $delivery_module_id) Return the first ChildOrder filtered by the delivery_module_id column @@ -139,7 +136,6 @@ use Thelia\Model\Map\OrderTableMap; * @method array findByTransactionRef(string $transaction_ref) Return ChildOrder objects filtered by the transaction_ref column * @method array findByDeliveryRef(string $delivery_ref) Return ChildOrder objects filtered by the delivery_ref column * @method array findByInvoiceRef(string $invoice_ref) Return ChildOrder objects filtered by the invoice_ref column - * @method array findByDiscount(double $discount) Return ChildOrder objects filtered by the discount column * @method array findByPostage(double $postage) Return ChildOrder objects filtered by the postage column * @method array findByPaymentModuleId(int $payment_module_id) Return ChildOrder objects filtered by the payment_module_id column * @method array findByDeliveryModuleId(int $delivery_module_id) Return ChildOrder objects filtered by the delivery_module_id column @@ -235,7 +231,7 @@ abstract class OrderQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `REF`, `CUSTOMER_ID`, `INVOICE_ORDER_ADDRESS_ID`, `DELIVERY_ORDER_ADDRESS_ID`, `INVOICE_DATE`, `CURRENCY_ID`, `CURRENCY_RATE`, `TRANSACTION_REF`, `DELIVERY_REF`, `INVOICE_REF`, `DISCOUNT`, `POSTAGE`, `PAYMENT_MODULE_ID`, `DELIVERY_MODULE_ID`, `STATUS_ID`, `LANG_ID`, `CREATED_AT`, `UPDATED_AT` FROM `order` WHERE `ID` = :p0'; + $sql = 'SELECT ID, REF, CUSTOMER_ID, INVOICE_ORDER_ADDRESS_ID, DELIVERY_ORDER_ADDRESS_ID, INVOICE_DATE, CURRENCY_ID, CURRENCY_RATE, TRANSACTION_REF, DELIVERY_REF, INVOICE_REF, POSTAGE, PAYMENT_MODULE_ID, DELIVERY_MODULE_ID, STATUS_ID, LANG_ID, CREATED_AT, UPDATED_AT FROM order WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -737,47 +733,6 @@ abstract class OrderQuery extends ModelCriteria return $this->addUsingAlias(OrderTableMap::INVOICE_REF, $invoiceRef, $comparison); } - /** - * Filter the query on the discount column - * - * Example usage: - * - * $query->filterByDiscount(1234); // WHERE discount = 1234 - * $query->filterByDiscount(array(12, 34)); // WHERE discount IN (12, 34) - * $query->filterByDiscount(array('min' => 12)); // WHERE discount > 12 - * - * - * @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 ChildOrderQuery 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(OrderTableMap::DISCOUNT, $discount['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($discount['max'])) { - $this->addUsingAlias(OrderTableMap::DISCOUNT, $discount['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(OrderTableMap::DISCOUNT, $discount, $comparison); - } - /** * Filter the query on the postage column * @@ -1751,40 +1706,40 @@ abstract class OrderQuery extends ModelCriteria } /** - * Filter the query by a related \Thelia\Model\OrderCoupon object + * Filter the query by a related \Thelia\Model\CouponOrder object * - * @param \Thelia\Model\OrderCoupon|ObjectCollection $orderCoupon the related object to use as filter + * @param \Thelia\Model\CouponOrder|ObjectCollection $couponOrder the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildOrderQuery The current query, for fluid interface */ - public function filterByOrderCoupon($orderCoupon, $comparison = null) + public function filterByCouponOrder($couponOrder, $comparison = null) { - if ($orderCoupon instanceof \Thelia\Model\OrderCoupon) { + if ($couponOrder instanceof \Thelia\Model\CouponOrder) { return $this - ->addUsingAlias(OrderTableMap::ID, $orderCoupon->getOrderId(), $comparison); - } elseif ($orderCoupon instanceof ObjectCollection) { + ->addUsingAlias(OrderTableMap::ID, $couponOrder->getOrderId(), $comparison); + } elseif ($couponOrder instanceof ObjectCollection) { return $this - ->useOrderCouponQuery() - ->filterByPrimaryKeys($orderCoupon->getPrimaryKeys()) + ->useCouponOrderQuery() + ->filterByPrimaryKeys($couponOrder->getPrimaryKeys()) ->endUse(); } else { - throw new PropelException('filterByOrderCoupon() only accepts arguments of type \Thelia\Model\OrderCoupon or Collection'); + throw new PropelException('filterByCouponOrder() only accepts arguments of type \Thelia\Model\CouponOrder or Collection'); } } /** - * Adds a JOIN clause to the query using the OrderCoupon relation + * Adds a JOIN clause to the query using the CouponOrder relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return ChildOrderQuery The current query, for fluid interface */ - public function joinOrderCoupon($relationAlias = null, $joinType = Criteria::INNER_JOIN) + public function joinCouponOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('OrderCoupon'); + $relationMap = $tableMap->getRelation('CouponOrder'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -1799,14 +1754,14 @@ abstract class OrderQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'OrderCoupon'); + $this->addJoinObject($join, 'CouponOrder'); } return $this; } /** - * Use the OrderCoupon relation OrderCoupon object + * Use the CouponOrder relation CouponOrder object * * @see useQuery() * @@ -1814,13 +1769,13 @@ abstract class OrderQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return \Thelia\Model\OrderCouponQuery A secondary query class using the current class as primary query + * @return \Thelia\Model\CouponOrderQuery A secondary query class using the current class as primary query */ - public function useOrderCouponQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) + public function useCouponOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this - ->joinOrderCoupon($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'OrderCoupon', '\Thelia\Model\OrderCouponQuery'); + ->joinCouponOrder($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CouponOrder', '\Thelia\Model\CouponOrderQuery'); } /** diff --git a/core/lib/Thelia/Model/Base/OrderStatus.php b/core/lib/Thelia/Model/Base/OrderStatus.php index 754876942..4a5e49436 100644 --- a/core/lib/Thelia/Model/Base/OrderStatus.php +++ b/core/lib/Thelia/Model/Base/OrderStatus.php @@ -854,20 +854,20 @@ abstract class OrderStatus implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderStatusTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderStatusTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(OrderStatusTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(OrderStatusTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `order_status` (%s) VALUES (%s)', + 'INSERT INTO order_status (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -876,16 +876,16 @@ abstract class OrderStatus implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/OrderStatusI18n.php b/core/lib/Thelia/Model/Base/OrderStatusI18n.php index 82a84fcea..d9f7f3b52 100644 --- a/core/lib/Thelia/Model/Base/OrderStatusI18n.php +++ b/core/lib/Thelia/Model/Base/OrderStatusI18n.php @@ -858,26 +858,26 @@ abstract class OrderStatusI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(OrderStatusI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(OrderStatusI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(OrderStatusI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(OrderStatusI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(OrderStatusI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(OrderStatusI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `order_status_i18n` (%s) VALUES (%s)', + 'INSERT INTO order_status_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class OrderStatusI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php b/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php index 1de0e360d..58127979f 100644 --- a/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php +++ b/core/lib/Thelia/Model/Base/OrderStatusI18nQuery.php @@ -147,7 +147,7 @@ abstract class OrderStatusI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `order_status_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM order_status_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/OrderStatusQuery.php b/core/lib/Thelia/Model/Base/OrderStatusQuery.php index 3fa57cb4b..7050b4a5a 100644 --- a/core/lib/Thelia/Model/Base/OrderStatusQuery.php +++ b/core/lib/Thelia/Model/Base/OrderStatusQuery.php @@ -144,7 +144,7 @@ abstract class OrderStatusQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `CREATED_AT`, `UPDATED_AT` FROM `order_status` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, CREATED_AT, UPDATED_AT FROM order_status WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Product.php b/core/lib/Thelia/Model/Base/Product.php index 2f7cb3468..50d8e96a3 100644 --- a/core/lib/Thelia/Model/Base/Product.php +++ b/core/lib/Thelia/Model/Base/Product.php @@ -1661,41 +1661,41 @@ abstract class Product implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductTableMap::TAX_RULE_ID)) { - $modifiedColumns[':p' . $index++] = '`TAX_RULE_ID`'; + $modifiedColumns[':p' . $index++] = 'TAX_RULE_ID'; } if ($this->isColumnModified(ProductTableMap::REF)) { - $modifiedColumns[':p' . $index++] = '`REF`'; + $modifiedColumns[':p' . $index++] = 'REF'; } if ($this->isColumnModified(ProductTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(ProductTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ProductTableMap::TEMPLATE_ID)) { - $modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`'; + $modifiedColumns[':p' . $index++] = 'TEMPLATE_ID'; } if ($this->isColumnModified(ProductTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(ProductTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(ProductTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(ProductTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `product` (%s) VALUES (%s)', + 'INSERT INTO product (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1704,37 +1704,37 @@ abstract class Product implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`TAX_RULE_ID`': + case 'TAX_RULE_ID': $stmt->bindValue($identifier, $this->tax_rule_id, PDO::PARAM_INT); break; - case '`REF`': + case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`TEMPLATE_ID`': + case 'TEMPLATE_ID': $stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProductAssociatedContent.php b/core/lib/Thelia/Model/Base/ProductAssociatedContent.php index a0ce4312c..764a7370c 100644 --- a/core/lib/Thelia/Model/Base/ProductAssociatedContent.php +++ b/core/lib/Thelia/Model/Base/ProductAssociatedContent.php @@ -904,26 +904,26 @@ abstract class ProductAssociatedContent implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductAssociatedContentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductAssociatedContentTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(ProductAssociatedContentTableMap::CONTENT_ID)) { - $modifiedColumns[':p' . $index++] = '`CONTENT_ID`'; + $modifiedColumns[':p' . $index++] = 'CONTENT_ID'; } if ($this->isColumnModified(ProductAssociatedContentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ProductAssociatedContentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductAssociatedContentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_associated_content` (%s) VALUES (%s)', + 'INSERT INTO product_associated_content (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -932,22 +932,22 @@ abstract class ProductAssociatedContent implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`CONTENT_ID`': + case 'CONTENT_ID': $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductAssociatedContentQuery.php b/core/lib/Thelia/Model/Base/ProductAssociatedContentQuery.php index 6ce76b876..d387f40ed 100644 --- a/core/lib/Thelia/Model/Base/ProductAssociatedContentQuery.php +++ b/core/lib/Thelia/Model/Base/ProductAssociatedContentQuery.php @@ -151,7 +151,7 @@ abstract class ProductAssociatedContentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `CONTENT_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `product_associated_content` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, CONTENT_ID, POSITION, CREATED_AT, UPDATED_AT FROM product_associated_content WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductCategory.php b/core/lib/Thelia/Model/Base/ProductCategory.php index 99448c960..2e00db24a 100644 --- a/core/lib/Thelia/Model/Base/ProductCategory.php +++ b/core/lib/Thelia/Model/Base/ProductCategory.php @@ -867,23 +867,23 @@ abstract class ProductCategory implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductCategoryTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(ProductCategoryTableMap::CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`CATEGORY_ID`'; + $modifiedColumns[':p' . $index++] = 'CATEGORY_ID'; } if ($this->isColumnModified(ProductCategoryTableMap::DEFAULT_CATEGORY)) { - $modifiedColumns[':p' . $index++] = '`DEFAULT_CATEGORY`'; + $modifiedColumns[':p' . $index++] = 'DEFAULT_CATEGORY'; } if ($this->isColumnModified(ProductCategoryTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductCategoryTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_category` (%s) VALUES (%s)', + 'INSERT INTO product_category (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -892,19 +892,19 @@ abstract class ProductCategory implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`CATEGORY_ID`': + case 'CATEGORY_ID': $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT); break; - case '`DEFAULT_CATEGORY`': + case 'DEFAULT_CATEGORY': $stmt->bindValue($identifier, (int) $this->default_category, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductCategoryQuery.php b/core/lib/Thelia/Model/Base/ProductCategoryQuery.php index 1d1e28830..df9fc630b 100644 --- a/core/lib/Thelia/Model/Base/ProductCategoryQuery.php +++ b/core/lib/Thelia/Model/Base/ProductCategoryQuery.php @@ -147,7 +147,7 @@ abstract class ProductCategoryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `PRODUCT_ID`, `CATEGORY_ID`, `DEFAULT_CATEGORY`, `CREATED_AT`, `UPDATED_AT` FROM `product_category` WHERE `PRODUCT_ID` = :p0 AND `CATEGORY_ID` = :p1'; + $sql = 'SELECT PRODUCT_ID, CATEGORY_ID, DEFAULT_CATEGORY, CREATED_AT, UPDATED_AT FROM product_category WHERE PRODUCT_ID = :p0 AND CATEGORY_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductDocument.php b/core/lib/Thelia/Model/Base/ProductDocument.php index e29fc582a..507539f45 100644 --- a/core/lib/Thelia/Model/Base/ProductDocument.php +++ b/core/lib/Thelia/Model/Base/ProductDocument.php @@ -930,26 +930,26 @@ abstract class ProductDocument implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductDocumentTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductDocumentTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(ProductDocumentTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(ProductDocumentTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ProductDocumentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductDocumentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_document` (%s) VALUES (%s)', + 'INSERT INTO product_document (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class ProductDocument implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductDocumentI18n.php b/core/lib/Thelia/Model/Base/ProductDocumentI18n.php index 18ec53fa2..2dff23586 100644 --- a/core/lib/Thelia/Model/Base/ProductDocumentI18n.php +++ b/core/lib/Thelia/Model/Base/ProductDocumentI18n.php @@ -858,26 +858,26 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductDocumentI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductDocumentI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ProductDocumentI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ProductDocumentI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ProductDocumentI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ProductDocumentI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `product_document_i18n` (%s) VALUES (%s)', + 'INSERT INTO product_document_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ProductDocumentI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php b/core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php index 79d4854b4..5bd94d297 100644 --- a/core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ProductDocumentI18nQuery.php @@ -147,7 +147,7 @@ abstract class ProductDocumentI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `product_document_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM product_document_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductDocumentQuery.php b/core/lib/Thelia/Model/Base/ProductDocumentQuery.php index f5d9d446c..06af05a9c 100644 --- a/core/lib/Thelia/Model/Base/ProductDocumentQuery.php +++ b/core/lib/Thelia/Model/Base/ProductDocumentQuery.php @@ -152,7 +152,7 @@ abstract class ProductDocumentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `product_document` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM product_document WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductI18n.php b/core/lib/Thelia/Model/Base/ProductI18n.php index b76519fe0..44f67373d 100644 --- a/core/lib/Thelia/Model/Base/ProductI18n.php +++ b/core/lib/Thelia/Model/Base/ProductI18n.php @@ -981,35 +981,35 @@ abstract class ProductI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ProductI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ProductI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ProductI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ProductI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } if ($this->isColumnModified(ProductI18nTableMap::META_TITLE)) { - $modifiedColumns[':p' . $index++] = '`META_TITLE`'; + $modifiedColumns[':p' . $index++] = 'META_TITLE'; } if ($this->isColumnModified(ProductI18nTableMap::META_DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`META_DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'META_DESCRIPTION'; } if ($this->isColumnModified(ProductI18nTableMap::META_KEYWORDS)) { - $modifiedColumns[':p' . $index++] = '`META_KEYWORDS`'; + $modifiedColumns[':p' . $index++] = 'META_KEYWORDS'; } $sql = sprintf( - 'INSERT INTO `product_i18n` (%s) VALUES (%s)', + 'INSERT INTO product_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1018,31 +1018,31 @@ abstract class ProductI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; - case '`META_TITLE`': + case 'META_TITLE': $stmt->bindValue($identifier, $this->meta_title, PDO::PARAM_STR); break; - case '`META_DESCRIPTION`': + case 'META_DESCRIPTION': $stmt->bindValue($identifier, $this->meta_description, PDO::PARAM_STR); break; - case '`META_KEYWORDS`': + case 'META_KEYWORDS': $stmt->bindValue($identifier, $this->meta_keywords, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProductI18nQuery.php b/core/lib/Thelia/Model/Base/ProductI18nQuery.php index ab99a0ef2..c9eae20ad 100644 --- a/core/lib/Thelia/Model/Base/ProductI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ProductI18nQuery.php @@ -159,7 +159,7 @@ abstract class ProductI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS` FROM `product_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM, META_TITLE, META_DESCRIPTION, META_KEYWORDS FROM product_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductImage.php b/core/lib/Thelia/Model/Base/ProductImage.php index 450cf5b91..873aa0ec7 100644 --- a/core/lib/Thelia/Model/Base/ProductImage.php +++ b/core/lib/Thelia/Model/Base/ProductImage.php @@ -930,26 +930,26 @@ abstract class ProductImage implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductImageTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductImageTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(ProductImageTableMap::FILE)) { - $modifiedColumns[':p' . $index++] = '`FILE`'; + $modifiedColumns[':p' . $index++] = 'FILE'; } if ($this->isColumnModified(ProductImageTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ProductImageTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductImageTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_image` (%s) VALUES (%s)', + 'INSERT INTO product_image (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -958,22 +958,22 @@ abstract class ProductImage implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`FILE`': + case 'FILE': $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductImageI18n.php b/core/lib/Thelia/Model/Base/ProductImageI18n.php index 2b725e831..76f9b38a9 100644 --- a/core/lib/Thelia/Model/Base/ProductImageI18n.php +++ b/core/lib/Thelia/Model/Base/ProductImageI18n.php @@ -858,26 +858,26 @@ abstract class ProductImageI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductImageI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductImageI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ProductImageI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ProductImageI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ProductImageI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ProductImageI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `product_image_i18n` (%s) VALUES (%s)', + 'INSERT INTO product_image_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ProductImageI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProductImageI18nQuery.php b/core/lib/Thelia/Model/Base/ProductImageI18nQuery.php index cb588e56c..c1f34fbb9 100644 --- a/core/lib/Thelia/Model/Base/ProductImageI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ProductImageI18nQuery.php @@ -147,7 +147,7 @@ abstract class ProductImageI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `product_image_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM product_image_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductImageQuery.php b/core/lib/Thelia/Model/Base/ProductImageQuery.php index cb73e994b..94cb1b361 100644 --- a/core/lib/Thelia/Model/Base/ProductImageQuery.php +++ b/core/lib/Thelia/Model/Base/ProductImageQuery.php @@ -152,7 +152,7 @@ abstract class ProductImageQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `FILE`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `product_image` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, FILE, POSITION, CREATED_AT, UPDATED_AT FROM product_image WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductPrice.php b/core/lib/Thelia/Model/Base/ProductPrice.php index aa92b460a..e5c5b3f27 100644 --- a/core/lib/Thelia/Model/Base/ProductPrice.php +++ b/core/lib/Thelia/Model/Base/ProductPrice.php @@ -979,29 +979,29 @@ abstract class ProductPrice implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_SALE_ELEMENTS_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_SALE_ELEMENTS_ID'; } if ($this->isColumnModified(ProductPriceTableMap::CURRENCY_ID)) { - $modifiedColumns[':p' . $index++] = '`CURRENCY_ID`'; + $modifiedColumns[':p' . $index++] = 'CURRENCY_ID'; } if ($this->isColumnModified(ProductPriceTableMap::PRICE)) { - $modifiedColumns[':p' . $index++] = '`PRICE`'; + $modifiedColumns[':p' . $index++] = 'PRICE'; } if ($this->isColumnModified(ProductPriceTableMap::PROMO_PRICE)) { - $modifiedColumns[':p' . $index++] = '`PROMO_PRICE`'; + $modifiedColumns[':p' . $index++] = 'PROMO_PRICE'; } if ($this->isColumnModified(ProductPriceTableMap::FROM_DEFAULT_CURRENCY)) { - $modifiedColumns[':p' . $index++] = '`FROM_DEFAULT_CURRENCY`'; + $modifiedColumns[':p' . $index++] = 'FROM_DEFAULT_CURRENCY'; } if ($this->isColumnModified(ProductPriceTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductPriceTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_price` (%s) VALUES (%s)', + 'INSERT INTO product_price (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1010,25 +1010,25 @@ abstract class ProductPrice implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`PRODUCT_SALE_ELEMENTS_ID`': + case 'PRODUCT_SALE_ELEMENTS_ID': $stmt->bindValue($identifier, $this->product_sale_elements_id, PDO::PARAM_INT); break; - case '`CURRENCY_ID`': + case 'CURRENCY_ID': $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT); break; - case '`PRICE`': + case 'PRICE': $stmt->bindValue($identifier, $this->price, PDO::PARAM_STR); break; - case '`PROMO_PRICE`': + case 'PROMO_PRICE': $stmt->bindValue($identifier, $this->promo_price, PDO::PARAM_STR); break; - case '`FROM_DEFAULT_CURRENCY`': + case 'FROM_DEFAULT_CURRENCY': $stmt->bindValue($identifier, (int) $this->from_default_currency, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductPriceQuery.php b/core/lib/Thelia/Model/Base/ProductPriceQuery.php index 269fc833c..1ea364459 100644 --- a/core/lib/Thelia/Model/Base/ProductPriceQuery.php +++ b/core/lib/Thelia/Model/Base/ProductPriceQuery.php @@ -155,7 +155,7 @@ abstract class ProductPriceQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `PRODUCT_SALE_ELEMENTS_ID`, `CURRENCY_ID`, `PRICE`, `PROMO_PRICE`, `FROM_DEFAULT_CURRENCY`, `CREATED_AT`, `UPDATED_AT` FROM `product_price` WHERE `PRODUCT_SALE_ELEMENTS_ID` = :p0 AND `CURRENCY_ID` = :p1'; + $sql = 'SELECT PRODUCT_SALE_ELEMENTS_ID, CURRENCY_ID, PRICE, PROMO_PRICE, FROM_DEFAULT_CURRENCY, CREATED_AT, UPDATED_AT FROM product_price WHERE PRODUCT_SALE_ELEMENTS_ID = :p0 AND CURRENCY_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductQuery.php b/core/lib/Thelia/Model/Base/ProductQuery.php index 352b5cc68..9c3b0759c 100644 --- a/core/lib/Thelia/Model/Base/ProductQuery.php +++ b/core/lib/Thelia/Model/Base/ProductQuery.php @@ -223,7 +223,7 @@ abstract class ProductQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product` WHERE `ID` = :p0'; + $sql = 'SELECT ID, TAX_RULE_ID, REF, VISIBLE, POSITION, TEMPLATE_ID, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductSaleElements.php b/core/lib/Thelia/Model/Base/ProductSaleElements.php index 3ace78d00..7911b63f7 100644 --- a/core/lib/Thelia/Model/Base/ProductSaleElements.php +++ b/core/lib/Thelia/Model/Base/ProductSaleElements.php @@ -1231,41 +1231,41 @@ abstract class ProductSaleElements implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductSaleElementsTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductSaleElementsTableMap::PRODUCT_ID)) { - $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`'; + $modifiedColumns[':p' . $index++] = 'PRODUCT_ID'; } if ($this->isColumnModified(ProductSaleElementsTableMap::REF)) { - $modifiedColumns[':p' . $index++] = '`REF`'; + $modifiedColumns[':p' . $index++] = 'REF'; } if ($this->isColumnModified(ProductSaleElementsTableMap::QUANTITY)) { - $modifiedColumns[':p' . $index++] = '`QUANTITY`'; + $modifiedColumns[':p' . $index++] = 'QUANTITY'; } if ($this->isColumnModified(ProductSaleElementsTableMap::PROMO)) { - $modifiedColumns[':p' . $index++] = '`PROMO`'; + $modifiedColumns[':p' . $index++] = 'PROMO'; } if ($this->isColumnModified(ProductSaleElementsTableMap::NEWNESS)) { - $modifiedColumns[':p' . $index++] = '`NEWNESS`'; + $modifiedColumns[':p' . $index++] = 'NEWNESS'; } if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) { - $modifiedColumns[':p' . $index++] = '`WEIGHT`'; + $modifiedColumns[':p' . $index++] = 'WEIGHT'; } if ($this->isColumnModified(ProductSaleElementsTableMap::IS_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`IS_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'IS_DEFAULT'; } if ($this->isColumnModified(ProductSaleElementsTableMap::EAN_CODE)) { - $modifiedColumns[':p' . $index++] = '`EAN_CODE`'; + $modifiedColumns[':p' . $index++] = 'EAN_CODE'; } if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `product_sale_elements` (%s) VALUES (%s)', + 'INSERT INTO product_sale_elements (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1274,37 +1274,37 @@ abstract class ProductSaleElements implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`PRODUCT_ID`': + case 'PRODUCT_ID': $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT); break; - case '`REF`': + case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`QUANTITY`': + case 'QUANTITY': $stmt->bindValue($identifier, $this->quantity, PDO::PARAM_STR); break; - case '`PROMO`': + case 'PROMO': $stmt->bindValue($identifier, $this->promo, PDO::PARAM_INT); break; - case '`NEWNESS`': + case 'NEWNESS': $stmt->bindValue($identifier, $this->newness, PDO::PARAM_INT); break; - case '`WEIGHT`': + case 'WEIGHT': $stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR); break; - case '`IS_DEFAULT`': + case 'IS_DEFAULT': $stmt->bindValue($identifier, (int) $this->is_default, PDO::PARAM_INT); break; - case '`EAN_CODE`': + case 'EAN_CODE': $stmt->bindValue($identifier, $this->ean_code, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php b/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php index 3a46a016d..3d169d24b 100644 --- a/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php +++ b/core/lib/Thelia/Model/Base/ProductSaleElementsQuery.php @@ -179,7 +179,7 @@ abstract class ProductSaleElementsQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `PRODUCT_ID`, `REF`, `QUANTITY`, `PROMO`, `NEWNESS`, `WEIGHT`, `IS_DEFAULT`, `EAN_CODE`, `CREATED_AT`, `UPDATED_AT` FROM `product_sale_elements` WHERE `ID` = :p0'; + $sql = 'SELECT ID, PRODUCT_ID, REF, QUANTITY, PROMO, NEWNESS, WEIGHT, IS_DEFAULT, EAN_CODE, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProductVersion.php b/core/lib/Thelia/Model/Base/ProductVersion.php index 54c628afa..f4327e4f1 100644 --- a/core/lib/Thelia/Model/Base/ProductVersion.php +++ b/core/lib/Thelia/Model/Base/ProductVersion.php @@ -1107,41 +1107,41 @@ abstract class ProductVersion implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProductVersionTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProductVersionTableMap::TAX_RULE_ID)) { - $modifiedColumns[':p' . $index++] = '`TAX_RULE_ID`'; + $modifiedColumns[':p' . $index++] = 'TAX_RULE_ID'; } if ($this->isColumnModified(ProductVersionTableMap::REF)) { - $modifiedColumns[':p' . $index++] = '`REF`'; + $modifiedColumns[':p' . $index++] = 'REF'; } if ($this->isColumnModified(ProductVersionTableMap::VISIBLE)) { - $modifiedColumns[':p' . $index++] = '`VISIBLE`'; + $modifiedColumns[':p' . $index++] = 'VISIBLE'; } if ($this->isColumnModified(ProductVersionTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(ProductVersionTableMap::TEMPLATE_ID)) { - $modifiedColumns[':p' . $index++] = '`TEMPLATE_ID`'; + $modifiedColumns[':p' . $index++] = 'TEMPLATE_ID'; } if ($this->isColumnModified(ProductVersionTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProductVersionTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } if ($this->isColumnModified(ProductVersionTableMap::VERSION)) { - $modifiedColumns[':p' . $index++] = '`VERSION`'; + $modifiedColumns[':p' . $index++] = 'VERSION'; } if ($this->isColumnModified(ProductVersionTableMap::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_AT'; } if ($this->isColumnModified(ProductVersionTableMap::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`VERSION_CREATED_BY`'; + $modifiedColumns[':p' . $index++] = 'VERSION_CREATED_BY'; } $sql = sprintf( - 'INSERT INTO `product_version` (%s) VALUES (%s)', + 'INSERT INTO product_version (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1150,37 +1150,37 @@ abstract class ProductVersion implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`TAX_RULE_ID`': + case 'TAX_RULE_ID': $stmt->bindValue($identifier, $this->tax_rule_id, PDO::PARAM_INT); break; - case '`REF`': + case 'REF': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`VISIBLE`': + case 'VISIBLE': $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; - case '`TEMPLATE_ID`': + case 'TEMPLATE_ID': $stmt->bindValue($identifier, $this->template_id, PDO::PARAM_INT); 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); 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); break; - case '`VERSION`': + case 'VERSION': $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); 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); break; - case '`VERSION_CREATED_BY`': + case 'VERSION_CREATED_BY': $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProductVersionQuery.php b/core/lib/Thelia/Model/Base/ProductVersionQuery.php index cf017b048..b659becb9 100644 --- a/core/lib/Thelia/Model/Base/ProductVersionQuery.php +++ b/core/lib/Thelia/Model/Base/ProductVersionQuery.php @@ -167,7 +167,7 @@ abstract class ProductVersionQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `TAX_RULE_ID`, `REF`, `VISIBLE`, `POSITION`, `TEMPLATE_ID`, `CREATED_AT`, `UPDATED_AT`, `VERSION`, `VERSION_CREATED_AT`, `VERSION_CREATED_BY` FROM `product_version` WHERE `ID` = :p0 AND `VERSION` = :p1'; + $sql = 'SELECT ID, TAX_RULE_ID, REF, VISIBLE, POSITION, TEMPLATE_ID, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY FROM product_version WHERE ID = :p0 AND VERSION = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Profile.php b/core/lib/Thelia/Model/Base/Profile.php index bbf597814..f4796c58e 100644 --- a/core/lib/Thelia/Model/Base/Profile.php +++ b/core/lib/Thelia/Model/Base/Profile.php @@ -962,20 +962,20 @@ abstract class Profile implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProfileTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProfileTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(ProfileTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProfileTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `profile` (%s) VALUES (%s)', + 'INSERT INTO profile (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -984,16 +984,16 @@ abstract class Profile implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProfileI18n.php b/core/lib/Thelia/Model/Base/ProfileI18n.php index 8fb69fa12..e9f026d6d 100644 --- a/core/lib/Thelia/Model/Base/ProfileI18n.php +++ b/core/lib/Thelia/Model/Base/ProfileI18n.php @@ -858,26 +858,26 @@ abstract class ProfileI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProfileI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ProfileI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ProfileI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ProfileI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ProfileI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ProfileI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `profile_i18n` (%s) VALUES (%s)', + 'INSERT INTO profile_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ProfileI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ProfileI18nQuery.php b/core/lib/Thelia/Model/Base/ProfileI18nQuery.php index 79a5510df..3c9367fb4 100644 --- a/core/lib/Thelia/Model/Base/ProfileI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ProfileI18nQuery.php @@ -147,7 +147,7 @@ abstract class ProfileI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `profile_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM profile_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProfileModule.php b/core/lib/Thelia/Model/Base/ProfileModule.php index 52e2986a6..11523f35c 100644 --- a/core/lib/Thelia/Model/Base/ProfileModule.php +++ b/core/lib/Thelia/Model/Base/ProfileModule.php @@ -877,23 +877,23 @@ abstract class ProfileModule implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProfileModuleTableMap::PROFILE_ID)) { - $modifiedColumns[':p' . $index++] = '`PROFILE_ID`'; + $modifiedColumns[':p' . $index++] = 'PROFILE_ID'; } if ($this->isColumnModified(ProfileModuleTableMap::MODULE_ID)) { - $modifiedColumns[':p' . $index++] = '`MODULE_ID`'; + $modifiedColumns[':p' . $index++] = 'MODULE_ID'; } if ($this->isColumnModified(ProfileModuleTableMap::ACCESS)) { - $modifiedColumns[':p' . $index++] = '`ACCESS`'; + $modifiedColumns[':p' . $index++] = 'ACCESS'; } if ($this->isColumnModified(ProfileModuleTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProfileModuleTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `profile_module` (%s) VALUES (%s)', + 'INSERT INTO profile_module (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -902,19 +902,19 @@ abstract class ProfileModule implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`PROFILE_ID`': + case 'PROFILE_ID': $stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT); break; - case '`MODULE_ID`': + case 'MODULE_ID': $stmt->bindValue($identifier, $this->module_id, PDO::PARAM_INT); break; - case '`ACCESS`': + case 'ACCESS': $stmt->bindValue($identifier, $this->access, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProfileModuleQuery.php b/core/lib/Thelia/Model/Base/ProfileModuleQuery.php index 4f49ccb2f..6622eae9e 100644 --- a/core/lib/Thelia/Model/Base/ProfileModuleQuery.php +++ b/core/lib/Thelia/Model/Base/ProfileModuleQuery.php @@ -147,7 +147,7 @@ abstract class ProfileModuleQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `PROFILE_ID`, `MODULE_ID`, `ACCESS`, `CREATED_AT`, `UPDATED_AT` FROM `profile_module` WHERE `PROFILE_ID` = :p0 AND `MODULE_ID` = :p1'; + $sql = 'SELECT PROFILE_ID, MODULE_ID, ACCESS, CREATED_AT, UPDATED_AT FROM profile_module WHERE PROFILE_ID = :p0 AND MODULE_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProfileQuery.php b/core/lib/Thelia/Model/Base/ProfileQuery.php index ad778a354..7937776c5 100644 --- a/core/lib/Thelia/Model/Base/ProfileQuery.php +++ b/core/lib/Thelia/Model/Base/ProfileQuery.php @@ -152,7 +152,7 @@ abstract class ProfileQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `CREATED_AT`, `UPDATED_AT` FROM `profile` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, CREATED_AT, UPDATED_AT FROM profile WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ProfileResource.php b/core/lib/Thelia/Model/Base/ProfileResource.php index 06f0b8773..e4efc6f6a 100644 --- a/core/lib/Thelia/Model/Base/ProfileResource.php +++ b/core/lib/Thelia/Model/Base/ProfileResource.php @@ -877,23 +877,23 @@ abstract class ProfileResource implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ProfileResourceTableMap::PROFILE_ID)) { - $modifiedColumns[':p' . $index++] = '`PROFILE_ID`'; + $modifiedColumns[':p' . $index++] = 'PROFILE_ID'; } if ($this->isColumnModified(ProfileResourceTableMap::RESOURCE_ID)) { - $modifiedColumns[':p' . $index++] = '`RESOURCE_ID`'; + $modifiedColumns[':p' . $index++] = 'RESOURCE_ID'; } if ($this->isColumnModified(ProfileResourceTableMap::ACCESS)) { - $modifiedColumns[':p' . $index++] = '`ACCESS`'; + $modifiedColumns[':p' . $index++] = 'ACCESS'; } if ($this->isColumnModified(ProfileResourceTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ProfileResourceTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `profile_resource` (%s) VALUES (%s)', + 'INSERT INTO profile_resource (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -902,19 +902,19 @@ abstract class ProfileResource implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`PROFILE_ID`': + case 'PROFILE_ID': $stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT); break; - case '`RESOURCE_ID`': + case 'RESOURCE_ID': $stmt->bindValue($identifier, $this->resource_id, PDO::PARAM_INT); break; - case '`ACCESS`': + case 'ACCESS': $stmt->bindValue($identifier, $this->access, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ProfileResourceQuery.php b/core/lib/Thelia/Model/Base/ProfileResourceQuery.php index e836ec5e0..c33ba7daa 100644 --- a/core/lib/Thelia/Model/Base/ProfileResourceQuery.php +++ b/core/lib/Thelia/Model/Base/ProfileResourceQuery.php @@ -147,7 +147,7 @@ abstract class ProfileResourceQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `PROFILE_ID`, `RESOURCE_ID`, `ACCESS`, `CREATED_AT`, `UPDATED_AT` FROM `profile_resource` WHERE `PROFILE_ID` = :p0 AND `RESOURCE_ID` = :p1'; + $sql = 'SELECT PROFILE_ID, RESOURCE_ID, ACCESS, CREATED_AT, UPDATED_AT FROM profile_resource WHERE PROFILE_ID = :p0 AND RESOURCE_ID = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Resource.php b/core/lib/Thelia/Model/Base/Resource.php index 1f899ec81..166fa7a16 100644 --- a/core/lib/Thelia/Model/Base/Resource.php +++ b/core/lib/Thelia/Model/Base/Resource.php @@ -895,20 +895,20 @@ abstract class Resource implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ResourceTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ResourceTableMap::CODE)) { - $modifiedColumns[':p' . $index++] = '`CODE`'; + $modifiedColumns[':p' . $index++] = 'CODE'; } if ($this->isColumnModified(ResourceTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(ResourceTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `resource` (%s) VALUES (%s)', + 'INSERT INTO resource (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -917,16 +917,16 @@ abstract class Resource implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`CODE`': + case 'CODE': $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/ResourceI18n.php b/core/lib/Thelia/Model/Base/ResourceI18n.php index 3a9ac35be..bd1104a90 100644 --- a/core/lib/Thelia/Model/Base/ResourceI18n.php +++ b/core/lib/Thelia/Model/Base/ResourceI18n.php @@ -858,26 +858,26 @@ abstract class ResourceI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(ResourceI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(ResourceI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(ResourceI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(ResourceI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } if ($this->isColumnModified(ResourceI18nTableMap::CHAPO)) { - $modifiedColumns[':p' . $index++] = '`CHAPO`'; + $modifiedColumns[':p' . $index++] = 'CHAPO'; } if ($this->isColumnModified(ResourceI18nTableMap::POSTSCRIPTUM)) { - $modifiedColumns[':p' . $index++] = '`POSTSCRIPTUM`'; + $modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM'; } $sql = sprintf( - 'INSERT INTO `resource_i18n` (%s) VALUES (%s)', + 'INSERT INTO resource_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -886,22 +886,22 @@ abstract class ResourceI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; - case '`CHAPO`': + case 'CHAPO': $stmt->bindValue($identifier, $this->chapo, PDO::PARAM_STR); break; - case '`POSTSCRIPTUM`': + case 'POSTSCRIPTUM': $stmt->bindValue($identifier, $this->postscriptum, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/ResourceI18nQuery.php b/core/lib/Thelia/Model/Base/ResourceI18nQuery.php index 839d212dc..8c9872943 100644 --- a/core/lib/Thelia/Model/Base/ResourceI18nQuery.php +++ b/core/lib/Thelia/Model/Base/ResourceI18nQuery.php @@ -147,7 +147,7 @@ abstract class ResourceI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION`, `CHAPO`, `POSTSCRIPTUM` FROM `resource_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM resource_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/ResourceQuery.php b/core/lib/Thelia/Model/Base/ResourceQuery.php index 613ab700a..72888d6a9 100644 --- a/core/lib/Thelia/Model/Base/ResourceQuery.php +++ b/core/lib/Thelia/Model/Base/ResourceQuery.php @@ -144,7 +144,7 @@ abstract class ResourceQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CODE`, `CREATED_AT`, `UPDATED_AT` FROM `resource` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CODE, CREATED_AT, UPDATED_AT FROM resource WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/RewritingArgument.php b/core/lib/Thelia/Model/Base/RewritingArgument.php index 66ad972de..e34778574 100644 --- a/core/lib/Thelia/Model/Base/RewritingArgument.php +++ b/core/lib/Thelia/Model/Base/RewritingArgument.php @@ -837,23 +837,23 @@ abstract class RewritingArgument implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(RewritingArgumentTableMap::REWRITING_URL_ID)) { - $modifiedColumns[':p' . $index++] = '`REWRITING_URL_ID`'; + $modifiedColumns[':p' . $index++] = 'REWRITING_URL_ID'; } if ($this->isColumnModified(RewritingArgumentTableMap::PARAMETER)) { - $modifiedColumns[':p' . $index++] = '`PARAMETER`'; + $modifiedColumns[':p' . $index++] = 'PARAMETER'; } if ($this->isColumnModified(RewritingArgumentTableMap::VALUE)) { - $modifiedColumns[':p' . $index++] = '`VALUE`'; + $modifiedColumns[':p' . $index++] = 'VALUE'; } if ($this->isColumnModified(RewritingArgumentTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(RewritingArgumentTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `rewriting_argument` (%s) VALUES (%s)', + 'INSERT INTO rewriting_argument (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -862,19 +862,19 @@ abstract class RewritingArgument implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`REWRITING_URL_ID`': + case 'REWRITING_URL_ID': $stmt->bindValue($identifier, $this->rewriting_url_id, PDO::PARAM_INT); break; - case '`PARAMETER`': + case 'PARAMETER': $stmt->bindValue($identifier, $this->parameter, PDO::PARAM_STR); break; - case '`VALUE`': + case 'VALUE': $stmt->bindValue($identifier, $this->value, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/RewritingArgumentQuery.php b/core/lib/Thelia/Model/Base/RewritingArgumentQuery.php index bb4dd9a6d..cd9ca4fd3 100644 --- a/core/lib/Thelia/Model/Base/RewritingArgumentQuery.php +++ b/core/lib/Thelia/Model/Base/RewritingArgumentQuery.php @@ -143,7 +143,7 @@ abstract class RewritingArgumentQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `REWRITING_URL_ID`, `PARAMETER`, `VALUE`, `CREATED_AT`, `UPDATED_AT` FROM `rewriting_argument` WHERE `REWRITING_URL_ID` = :p0 AND `PARAMETER` = :p1 AND `VALUE` = :p2'; + $sql = 'SELECT REWRITING_URL_ID, PARAMETER, VALUE, CREATED_AT, UPDATED_AT FROM rewriting_argument WHERE REWRITING_URL_ID = :p0 AND PARAMETER = :p1 AND VALUE = :p2'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/RewritingUrl.php b/core/lib/Thelia/Model/Base/RewritingUrl.php index 979ce378c..06fa093b2 100644 --- a/core/lib/Thelia/Model/Base/RewritingUrl.php +++ b/core/lib/Thelia/Model/Base/RewritingUrl.php @@ -1028,32 +1028,32 @@ abstract class RewritingUrl implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(RewritingUrlTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(RewritingUrlTableMap::URL)) { - $modifiedColumns[':p' . $index++] = '`URL`'; + $modifiedColumns[':p' . $index++] = 'URL'; } if ($this->isColumnModified(RewritingUrlTableMap::VIEW)) { - $modifiedColumns[':p' . $index++] = '`VIEW`'; + $modifiedColumns[':p' . $index++] = 'VIEW'; } if ($this->isColumnModified(RewritingUrlTableMap::VIEW_ID)) { - $modifiedColumns[':p' . $index++] = '`VIEW_ID`'; + $modifiedColumns[':p' . $index++] = 'VIEW_ID'; } if ($this->isColumnModified(RewritingUrlTableMap::VIEW_LOCALE)) { - $modifiedColumns[':p' . $index++] = '`VIEW_LOCALE`'; + $modifiedColumns[':p' . $index++] = 'VIEW_LOCALE'; } if ($this->isColumnModified(RewritingUrlTableMap::REDIRECTED)) { - $modifiedColumns[':p' . $index++] = '`REDIRECTED`'; + $modifiedColumns[':p' . $index++] = 'REDIRECTED'; } if ($this->isColumnModified(RewritingUrlTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(RewritingUrlTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `rewriting_url` (%s) VALUES (%s)', + 'INSERT INTO rewriting_url (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -1062,28 +1062,28 @@ abstract class RewritingUrl implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`URL`': + case 'URL': $stmt->bindValue($identifier, $this->url, PDO::PARAM_STR); break; - case '`VIEW`': + case 'VIEW': $stmt->bindValue($identifier, $this->view, PDO::PARAM_STR); break; - case '`VIEW_ID`': + case 'VIEW_ID': $stmt->bindValue($identifier, $this->view_id, PDO::PARAM_STR); break; - case '`VIEW_LOCALE`': + case 'VIEW_LOCALE': $stmt->bindValue($identifier, $this->view_locale, PDO::PARAM_STR); break; - case '`REDIRECTED`': + case 'REDIRECTED': $stmt->bindValue($identifier, $this->redirected, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/RewritingUrlQuery.php b/core/lib/Thelia/Model/Base/RewritingUrlQuery.php index 9c6a0450b..c3c73b923 100644 --- a/core/lib/Thelia/Model/Base/RewritingUrlQuery.php +++ b/core/lib/Thelia/Model/Base/RewritingUrlQuery.php @@ -163,7 +163,7 @@ abstract class RewritingUrlQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `URL`, `VIEW`, `VIEW_ID`, `VIEW_LOCALE`, `REDIRECTED`, `CREATED_AT`, `UPDATED_AT` FROM `rewriting_url` WHERE `ID` = :p0'; + $sql = 'SELECT ID, URL, VIEW, VIEW_ID, VIEW_LOCALE, REDIRECTED, CREATED_AT, UPDATED_AT FROM rewriting_url WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Tax.php b/core/lib/Thelia/Model/Base/Tax.php index 51a5aed11..2ca5a8735 100644 --- a/core/lib/Thelia/Model/Base/Tax.php +++ b/core/lib/Thelia/Model/Base/Tax.php @@ -895,23 +895,23 @@ abstract class Tax implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TaxTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TaxTableMap::TYPE)) { - $modifiedColumns[':p' . $index++] = '`TYPE`'; + $modifiedColumns[':p' . $index++] = 'TYPE'; } if ($this->isColumnModified(TaxTableMap::SERIALIZED_REQUIREMENTS)) { - $modifiedColumns[':p' . $index++] = '`SERIALIZED_REQUIREMENTS`'; + $modifiedColumns[':p' . $index++] = 'SERIALIZED_REQUIREMENTS'; } if ($this->isColumnModified(TaxTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(TaxTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `tax` (%s) VALUES (%s)', + 'INSERT INTO tax (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -920,19 +920,19 @@ abstract class Tax implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`TYPE`': + case 'TYPE': $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR); break; - case '`SERIALIZED_REQUIREMENTS`': + case 'SERIALIZED_REQUIREMENTS': $stmt->bindValue($identifier, $this->serialized_requirements, PDO::PARAM_STR); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/TaxI18n.php b/core/lib/Thelia/Model/Base/TaxI18n.php index 2a4a2d316..cedf8b348 100644 --- a/core/lib/Thelia/Model/Base/TaxI18n.php +++ b/core/lib/Thelia/Model/Base/TaxI18n.php @@ -776,20 +776,20 @@ abstract class TaxI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TaxI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TaxI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(TaxI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(TaxI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } $sql = sprintf( - 'INSERT INTO `tax_i18n` (%s) VALUES (%s)', + 'INSERT INTO tax_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -798,16 +798,16 @@ abstract class TaxI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/TaxI18nQuery.php b/core/lib/Thelia/Model/Base/TaxI18nQuery.php index 7514a394a..e23b36155 100644 --- a/core/lib/Thelia/Model/Base/TaxI18nQuery.php +++ b/core/lib/Thelia/Model/Base/TaxI18nQuery.php @@ -139,7 +139,7 @@ abstract class TaxI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION` FROM `tax_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION FROM tax_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/TaxQuery.php b/core/lib/Thelia/Model/Base/TaxQuery.php index 67fc3a3ec..93da10f53 100644 --- a/core/lib/Thelia/Model/Base/TaxQuery.php +++ b/core/lib/Thelia/Model/Base/TaxQuery.php @@ -148,7 +148,7 @@ abstract class TaxQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `TYPE`, `SERIALIZED_REQUIREMENTS`, `CREATED_AT`, `UPDATED_AT` FROM `tax` WHERE `ID` = :p0'; + $sql = 'SELECT ID, TYPE, SERIALIZED_REQUIREMENTS, CREATED_AT, UPDATED_AT FROM tax WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/TaxRule.php b/core/lib/Thelia/Model/Base/TaxRule.php index e56dfa622..7accb0df8 100644 --- a/core/lib/Thelia/Model/Base/TaxRule.php +++ b/core/lib/Thelia/Model/Base/TaxRule.php @@ -914,20 +914,20 @@ abstract class TaxRule implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TaxRuleTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TaxRuleTableMap::IS_DEFAULT)) { - $modifiedColumns[':p' . $index++] = '`IS_DEFAULT`'; + $modifiedColumns[':p' . $index++] = 'IS_DEFAULT'; } if ($this->isColumnModified(TaxRuleTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(TaxRuleTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `tax_rule` (%s) VALUES (%s)', + 'INSERT INTO tax_rule (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -936,16 +936,16 @@ abstract class TaxRule implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`IS_DEFAULT`': + case 'IS_DEFAULT': $stmt->bindValue($identifier, (int) $this->is_default, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/TaxRuleCountry.php b/core/lib/Thelia/Model/Base/TaxRuleCountry.php index a6d24e68a..de527540c 100644 --- a/core/lib/Thelia/Model/Base/TaxRuleCountry.php +++ b/core/lib/Thelia/Model/Base/TaxRuleCountry.php @@ -922,26 +922,26 @@ abstract class TaxRuleCountry implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_RULE_ID)) { - $modifiedColumns[':p' . $index++] = '`TAX_RULE_ID`'; + $modifiedColumns[':p' . $index++] = 'TAX_RULE_ID'; } if ($this->isColumnModified(TaxRuleCountryTableMap::COUNTRY_ID)) { - $modifiedColumns[':p' . $index++] = '`COUNTRY_ID`'; + $modifiedColumns[':p' . $index++] = 'COUNTRY_ID'; } if ($this->isColumnModified(TaxRuleCountryTableMap::TAX_ID)) { - $modifiedColumns[':p' . $index++] = '`TAX_ID`'; + $modifiedColumns[':p' . $index++] = 'TAX_ID'; } if ($this->isColumnModified(TaxRuleCountryTableMap::POSITION)) { - $modifiedColumns[':p' . $index++] = '`POSITION`'; + $modifiedColumns[':p' . $index++] = 'POSITION'; } if ($this->isColumnModified(TaxRuleCountryTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(TaxRuleCountryTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `tax_rule_country` (%s) VALUES (%s)', + 'INSERT INTO tax_rule_country (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -950,22 +950,22 @@ abstract class TaxRuleCountry implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`TAX_RULE_ID`': + case 'TAX_RULE_ID': $stmt->bindValue($identifier, $this->tax_rule_id, PDO::PARAM_INT); break; - case '`COUNTRY_ID`': + case 'COUNTRY_ID': $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT); break; - case '`TAX_ID`': + case 'TAX_ID': $stmt->bindValue($identifier, $this->tax_id, PDO::PARAM_INT); break; - case '`POSITION`': + case 'POSITION': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php b/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php index 02f5079af..5674643f7 100644 --- a/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php +++ b/core/lib/Thelia/Model/Base/TaxRuleCountryQuery.php @@ -155,7 +155,7 @@ abstract class TaxRuleCountryQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `TAX_RULE_ID`, `COUNTRY_ID`, `TAX_ID`, `POSITION`, `CREATED_AT`, `UPDATED_AT` FROM `tax_rule_country` WHERE `TAX_RULE_ID` = :p0 AND `COUNTRY_ID` = :p1 AND `TAX_ID` = :p2'; + $sql = 'SELECT TAX_RULE_ID, COUNTRY_ID, TAX_ID, POSITION, CREATED_AT, UPDATED_AT FROM tax_rule_country WHERE TAX_RULE_ID = :p0 AND COUNTRY_ID = :p1 AND TAX_ID = :p2'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/TaxRuleI18n.php b/core/lib/Thelia/Model/Base/TaxRuleI18n.php index b28787f05..535195fb7 100644 --- a/core/lib/Thelia/Model/Base/TaxRuleI18n.php +++ b/core/lib/Thelia/Model/Base/TaxRuleI18n.php @@ -776,20 +776,20 @@ abstract class TaxRuleI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TaxRuleI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TaxRuleI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(TaxRuleI18nTableMap::TITLE)) { - $modifiedColumns[':p' . $index++] = '`TITLE`'; + $modifiedColumns[':p' . $index++] = 'TITLE'; } if ($this->isColumnModified(TaxRuleI18nTableMap::DESCRIPTION)) { - $modifiedColumns[':p' . $index++] = '`DESCRIPTION`'; + $modifiedColumns[':p' . $index++] = 'DESCRIPTION'; } $sql = sprintf( - 'INSERT INTO `tax_rule_i18n` (%s) VALUES (%s)', + 'INSERT INTO tax_rule_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -798,16 +798,16 @@ abstract class TaxRuleI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`TITLE`': + case 'TITLE': $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR); break; - case '`DESCRIPTION`': + case 'DESCRIPTION': $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php b/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php index 25ad51db5..dfb3e100c 100644 --- a/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php +++ b/core/lib/Thelia/Model/Base/TaxRuleI18nQuery.php @@ -139,7 +139,7 @@ abstract class TaxRuleI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `TITLE`, `DESCRIPTION` FROM `tax_rule_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION FROM tax_rule_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/TaxRuleQuery.php b/core/lib/Thelia/Model/Base/TaxRuleQuery.php index 5d2743bfd..bc20c44b1 100644 --- a/core/lib/Thelia/Model/Base/TaxRuleQuery.php +++ b/core/lib/Thelia/Model/Base/TaxRuleQuery.php @@ -148,7 +148,7 @@ abstract class TaxRuleQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `IS_DEFAULT`, `CREATED_AT`, `UPDATED_AT` FROM `tax_rule` WHERE `ID` = :p0'; + $sql = 'SELECT ID, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM tax_rule WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/Template.php b/core/lib/Thelia/Model/Base/Template.php index 922c9e5a4..fdb767c96 100644 --- a/core/lib/Thelia/Model/Base/Template.php +++ b/core/lib/Thelia/Model/Base/Template.php @@ -962,17 +962,17 @@ abstract class Template implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TemplateTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TemplateTableMap::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`CREATED_AT`'; + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; } if ($this->isColumnModified(TemplateTableMap::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`UPDATED_AT`'; + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; } $sql = sprintf( - 'INSERT INTO `template` (%s) VALUES (%s)', + 'INSERT INTO template (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -981,13 +981,13 @@ abstract class Template implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); 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); 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); break; } diff --git a/core/lib/Thelia/Model/Base/TemplateI18n.php b/core/lib/Thelia/Model/Base/TemplateI18n.php index 00f022d65..67ec21bc5 100644 --- a/core/lib/Thelia/Model/Base/TemplateI18n.php +++ b/core/lib/Thelia/Model/Base/TemplateI18n.php @@ -735,17 +735,17 @@ abstract class TemplateI18n implements ActiveRecordInterface // check the columns in natural order for more readable SQL queries if ($this->isColumnModified(TemplateI18nTableMap::ID)) { - $modifiedColumns[':p' . $index++] = '`ID`'; + $modifiedColumns[':p' . $index++] = 'ID'; } if ($this->isColumnModified(TemplateI18nTableMap::LOCALE)) { - $modifiedColumns[':p' . $index++] = '`LOCALE`'; + $modifiedColumns[':p' . $index++] = 'LOCALE'; } if ($this->isColumnModified(TemplateI18nTableMap::NAME)) { - $modifiedColumns[':p' . $index++] = '`NAME`'; + $modifiedColumns[':p' . $index++] = 'NAME'; } $sql = sprintf( - 'INSERT INTO `template_i18n` (%s) VALUES (%s)', + 'INSERT INTO template_i18n (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)) ); @@ -754,13 +754,13 @@ abstract class TemplateI18n implements ActiveRecordInterface $stmt = $con->prepare($sql); foreach ($modifiedColumns as $identifier => $columnName) { switch ($columnName) { - case '`ID`': + case 'ID': $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); break; - case '`LOCALE`': + case 'LOCALE': $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR); break; - case '`NAME`': + case 'NAME': $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); break; } diff --git a/core/lib/Thelia/Model/Base/TemplateI18nQuery.php b/core/lib/Thelia/Model/Base/TemplateI18nQuery.php index 2607e770f..12e7b7d1f 100644 --- a/core/lib/Thelia/Model/Base/TemplateI18nQuery.php +++ b/core/lib/Thelia/Model/Base/TemplateI18nQuery.php @@ -135,7 +135,7 @@ abstract class TemplateI18nQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `LOCALE`, `NAME` FROM `template_i18n` WHERE `ID` = :p0 AND `LOCALE` = :p1'; + $sql = 'SELECT ID, LOCALE, NAME FROM template_i18n WHERE ID = :p0 AND LOCALE = :p1'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Base/TemplateQuery.php b/core/lib/Thelia/Model/Base/TemplateQuery.php index f6821b35d..98c588dd8 100644 --- a/core/lib/Thelia/Model/Base/TemplateQuery.php +++ b/core/lib/Thelia/Model/Base/TemplateQuery.php @@ -148,7 +148,7 @@ abstract class TemplateQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `CREATED_AT`, `UPDATED_AT` FROM `template` WHERE `ID` = :p0'; + $sql = 'SELECT ID, CREATED_AT, UPDATED_AT FROM template WHERE ID = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); diff --git a/core/lib/Thelia/Model/Cart.php b/core/lib/Thelia/Model/Cart.php index 88d2caa2e..c1f28bc3d 100755 --- a/core/lib/Thelia/Model/Cart.php +++ b/core/lib/Thelia/Model/Cart.php @@ -83,6 +83,7 @@ class Cart extends BaseCart foreach($this->getCartItems() as $cartItem) { $subtotal = $cartItem->getRealPrice(); + $subtotal -= $cartItem->getDiscount(); /* we round it for the unit price, before the quantity factor */ $subtotal = round($taxCalculator->load($cartItem->getProduct(), $country)->getTaxedPrice($subtotal), 2); $subtotal *= $cartItem->getQuantity(); @@ -101,6 +102,7 @@ class Cart extends BaseCart foreach($this->getCartItems() as $cartItem) { $subtotal = $cartItem->getRealPrice(); + $subtotal -= $cartItem->getDiscount(); $subtotal *= $cartItem->getQuantity(); $total += $subtotal; diff --git a/core/lib/Thelia/Model/CouponOrder.php b/core/lib/Thelia/Model/CouponOrder.php new file mode 100755 index 000000000..65c326e60 --- /dev/null +++ b/core/lib/Thelia/Model/CouponOrder.php @@ -0,0 +1,9 @@ + array('Id', 'CartId', 'ProductId', 'Quantity', 'ProductSaleElementsId', 'Price', 'PromoPrice', 'PriceEndOfLife', 'Promo', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'productSaleElementsId', 'price', 'promoPrice', 'priceEndOfLife', 'promo', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, CartItemTableMap::PRICE, CartItemTableMap::PROMO_PRICE, CartItemTableMap::PRICE_END_OF_LIFE, CartItemTableMap::PROMO, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'PRODUCT_SALE_ELEMENTS_ID', 'PRICE', 'PROMO_PRICE', 'PRICE_END_OF_LIFE', 'PROMO', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'product_sale_elements_id', 'price', 'promo_price', 'price_end_of_life', 'promo', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) + self::TYPE_PHPNAME => array('Id', 'CartId', 'ProductId', 'Quantity', 'ProductSaleElementsId', 'Price', 'PromoPrice', 'PriceEndOfLife', 'Discount', 'Promo', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'productSaleElementsId', 'price', 'promoPrice', 'priceEndOfLife', 'discount', 'promo', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, CartItemTableMap::PRICE, CartItemTableMap::PROMO_PRICE, CartItemTableMap::PRICE_END_OF_LIFE, CartItemTableMap::DISCOUNT, CartItemTableMap::PROMO, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'PRODUCT_SALE_ELEMENTS_ID', 'PRICE', 'PROMO_PRICE', 'PRICE_END_OF_LIFE', 'DISCOUNT', 'PROMO', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'product_sale_elements_id', 'price', 'promo_price', 'price_end_of_life', 'discount', 'promo', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) ); /** @@ -151,12 +156,12 @@ class CartItemTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'ProductSaleElementsId' => 4, 'Price' => 5, 'PromoPrice' => 6, 'PriceEndOfLife' => 7, 'Promo' => 8, 'CreatedAt' => 9, 'UpdatedAt' => 10, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'productSaleElementsId' => 4, 'price' => 5, 'promoPrice' => 6, 'priceEndOfLife' => 7, 'promo' => 8, 'createdAt' => 9, 'updatedAt' => 10, ), - self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID => 4, CartItemTableMap::PRICE => 5, CartItemTableMap::PROMO_PRICE => 6, CartItemTableMap::PRICE_END_OF_LIFE => 7, CartItemTableMap::PROMO => 8, CartItemTableMap::CREATED_AT => 9, CartItemTableMap::UPDATED_AT => 10, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'PRODUCT_SALE_ELEMENTS_ID' => 4, 'PRICE' => 5, 'PROMO_PRICE' => 6, 'PRICE_END_OF_LIFE' => 7, 'PROMO' => 8, 'CREATED_AT' => 9, 'UPDATED_AT' => 10, ), - self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'product_sale_elements_id' => 4, 'price' => 5, 'promo_price' => 6, 'price_end_of_life' => 7, 'promo' => 8, 'created_at' => 9, 'updated_at' => 10, ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) + self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'ProductSaleElementsId' => 4, 'Price' => 5, 'PromoPrice' => 6, 'PriceEndOfLife' => 7, 'Discount' => 8, 'Promo' => 9, 'CreatedAt' => 10, 'UpdatedAt' => 11, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'productSaleElementsId' => 4, 'price' => 5, 'promoPrice' => 6, 'priceEndOfLife' => 7, 'discount' => 8, 'promo' => 9, 'createdAt' => 10, 'updatedAt' => 11, ), + self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID => 4, CartItemTableMap::PRICE => 5, CartItemTableMap::PROMO_PRICE => 6, CartItemTableMap::PRICE_END_OF_LIFE => 7, CartItemTableMap::DISCOUNT => 8, CartItemTableMap::PROMO => 9, CartItemTableMap::CREATED_AT => 10, CartItemTableMap::UPDATED_AT => 11, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'PRODUCT_SALE_ELEMENTS_ID' => 4, 'PRICE' => 5, 'PROMO_PRICE' => 6, 'PRICE_END_OF_LIFE' => 7, 'DISCOUNT' => 8, 'PROMO' => 9, 'CREATED_AT' => 10, 'UPDATED_AT' => 11, ), + self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'product_sale_elements_id' => 4, 'price' => 5, 'promo_price' => 6, 'price_end_of_life' => 7, 'discount' => 8, 'promo' => 9, 'created_at' => 10, 'updated_at' => 11, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) ); /** @@ -183,6 +188,7 @@ class CartItemTableMap extends TableMap $this->addColumn('PRICE', 'Price', 'FLOAT', false, null, null); $this->addColumn('PROMO_PRICE', 'PromoPrice', 'FLOAT', false, null, null); $this->addColumn('PRICE_END_OF_LIFE', 'PriceEndOfLife', 'TIMESTAMP', false, null, null); + $this->addColumn('DISCOUNT', 'Discount', 'FLOAT', false, null, 0); $this->addColumn('PROMO', 'Promo', 'INTEGER', false, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); @@ -357,6 +363,7 @@ class CartItemTableMap extends TableMap $criteria->addSelectColumn(CartItemTableMap::PRICE); $criteria->addSelectColumn(CartItemTableMap::PROMO_PRICE); $criteria->addSelectColumn(CartItemTableMap::PRICE_END_OF_LIFE); + $criteria->addSelectColumn(CartItemTableMap::DISCOUNT); $criteria->addSelectColumn(CartItemTableMap::PROMO); $criteria->addSelectColumn(CartItemTableMap::CREATED_AT); $criteria->addSelectColumn(CartItemTableMap::UPDATED_AT); @@ -369,6 +376,7 @@ class CartItemTableMap extends TableMap $criteria->addSelectColumn($alias . '.PRICE'); $criteria->addSelectColumn($alias . '.PROMO_PRICE'); $criteria->addSelectColumn($alias . '.PRICE_END_OF_LIFE'); + $criteria->addSelectColumn($alias . '.DISCOUNT'); $criteria->addSelectColumn($alias . '.PROMO'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); diff --git a/core/lib/Thelia/Model/Map/OrderCouponTableMap.php b/core/lib/Thelia/Model/Map/CouponOrderTableMap.php similarity index 54% rename from core/lib/Thelia/Model/Map/OrderCouponTableMap.php rename to core/lib/Thelia/Model/Map/CouponOrderTableMap.php index c77a046f0..d96183505 100644 --- a/core/lib/Thelia/Model/Map/OrderCouponTableMap.php +++ b/core/lib/Thelia/Model/Map/CouponOrderTableMap.php @@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Map\RelationMap; use Propel\Runtime\Map\TableMap; use Propel\Runtime\Map\TableMapTrait; -use Thelia\Model\OrderCoupon; -use Thelia\Model\OrderCouponQuery; +use Thelia\Model\CouponOrder; +use Thelia\Model\CouponOrderQuery; /** - * This class defines the structure of the 'order_coupon' table. + * This class defines the structure of the 'coupon_order' table. * * * @@ -25,14 +25,14 @@ use Thelia\Model\OrderCouponQuery; * (i.e. if it's a text column type). * */ -class OrderCouponTableMap extends TableMap +class CouponOrderTableMap extends TableMap { use InstancePoolTrait; use TableMapTrait; /** * The (dot-path) name of this class */ - const CLASS_NAME = 'Thelia.Model.Map.OrderCouponTableMap'; + const CLASS_NAME = 'Thelia.Model.Map.CouponOrderTableMap'; /** * The default database name for this class @@ -42,22 +42,22 @@ class OrderCouponTableMap extends TableMap /** * The table name for this class */ - const TABLE_NAME = 'order_coupon'; + const TABLE_NAME = 'coupon_order'; /** * The related Propel class for this table */ - const OM_CLASS = '\\Thelia\\Model\\OrderCoupon'; + const OM_CLASS = '\\Thelia\\Model\\CouponOrder'; /** * A class that can be returned by this tableMap */ - const CLASS_DEFAULT = 'Thelia.Model.OrderCoupon'; + const CLASS_DEFAULT = 'Thelia.Model.CouponOrder'; /** * The total number of columns */ - const NUM_COLUMNS = 15; + const NUM_COLUMNS = 5; /** * The number of lazy-loaded columns @@ -67,82 +67,32 @@ class OrderCouponTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 15; + const NUM_HYDRATE_COLUMNS = 5; /** * the column name for the ID field */ - const ID = 'order_coupon.ID'; + const ID = 'coupon_order.ID'; /** * the column name for the ORDER_ID field */ - const ORDER_ID = 'order_coupon.ORDER_ID'; + const ORDER_ID = 'coupon_order.ORDER_ID'; /** - * the column name for the CODE field + * the column name for the VALUE field */ - const CODE = 'order_coupon.CODE'; - - /** - * the column name for the TYPE field - */ - const TYPE = 'order_coupon.TYPE'; - - /** - * the column name for the AMOUNT field - */ - const AMOUNT = 'order_coupon.AMOUNT'; - - /** - * the column name for the TITLE field - */ - const TITLE = 'order_coupon.TITLE'; - - /** - * the column name for the SHORT_DESCRIPTION field - */ - const SHORT_DESCRIPTION = 'order_coupon.SHORT_DESCRIPTION'; - - /** - * the column name for the DESCRIPTION field - */ - const DESCRIPTION = 'order_coupon.DESCRIPTION'; - - /** - * the column name for the EXPIRATION_DATE field - */ - const EXPIRATION_DATE = 'order_coupon.EXPIRATION_DATE'; - - /** - * the column name for the IS_CUMULATIVE field - */ - const IS_CUMULATIVE = 'order_coupon.IS_CUMULATIVE'; - - /** - * the column name for the IS_REMOVING_POSTAGE field - */ - const IS_REMOVING_POSTAGE = 'order_coupon.IS_REMOVING_POSTAGE'; - - /** - * the column name for the IS_AVAILABLE_ON_SPECIAL_OFFERS field - */ - const IS_AVAILABLE_ON_SPECIAL_OFFERS = 'order_coupon.IS_AVAILABLE_ON_SPECIAL_OFFERS'; - - /** - * the column name for the SERIALIZED_CONDITIONS field - */ - const SERIALIZED_CONDITIONS = 'order_coupon.SERIALIZED_CONDITIONS'; + const VALUE = 'coupon_order.VALUE'; /** * the column name for the CREATED_AT field */ - const CREATED_AT = 'order_coupon.CREATED_AT'; + const CREATED_AT = 'coupon_order.CREATED_AT'; /** * the column name for the UPDATED_AT field */ - const UPDATED_AT = 'order_coupon.UPDATED_AT'; + const UPDATED_AT = 'coupon_order.UPDATED_AT'; /** * The default string format for model objects of the related table @@ -156,12 +106,12 @@ class OrderCouponTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'OrderId', 'Code', 'Type', 'Amount', 'Title', 'ShortDescription', 'Description', 'ExpirationDate', 'IsCumulative', 'IsRemovingPostage', 'IsAvailableOnSpecialOffers', 'SerializedConditions', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'code', 'type', 'amount', 'title', 'shortDescription', 'description', 'expirationDate', 'isCumulative', 'isRemovingPostage', 'isAvailableOnSpecialOffers', 'serializedConditions', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(OrderCouponTableMap::ID, OrderCouponTableMap::ORDER_ID, OrderCouponTableMap::CODE, OrderCouponTableMap::TYPE, OrderCouponTableMap::AMOUNT, OrderCouponTableMap::TITLE, OrderCouponTableMap::SHORT_DESCRIPTION, OrderCouponTableMap::DESCRIPTION, OrderCouponTableMap::EXPIRATION_DATE, OrderCouponTableMap::IS_CUMULATIVE, OrderCouponTableMap::IS_REMOVING_POSTAGE, OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS, OrderCouponTableMap::SERIALIZED_CONDITIONS, OrderCouponTableMap::CREATED_AT, OrderCouponTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'CODE', 'TYPE', 'AMOUNT', 'TITLE', 'SHORT_DESCRIPTION', 'DESCRIPTION', 'EXPIRATION_DATE', 'IS_CUMULATIVE', 'IS_REMOVING_POSTAGE', 'IS_AVAILABLE_ON_SPECIAL_OFFERS', 'SERIALIZED_CONDITIONS', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'order_id', 'code', 'type', 'amount', 'title', 'short_description', 'description', 'expiration_date', 'is_cumulative', 'is_removing_postage', 'is_available_on_special_offers', 'serialized_conditions', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ) + self::TYPE_PHPNAME => array('Id', 'OrderId', 'Value', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'value', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(CouponOrderTableMap::ID, CouponOrderTableMap::ORDER_ID, CouponOrderTableMap::VALUE, CouponOrderTableMap::CREATED_AT, CouponOrderTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'VALUE', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'order_id', 'value', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -171,12 +121,12 @@ class OrderCouponTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'Code' => 2, 'Type' => 3, 'Amount' => 4, 'Title' => 5, 'ShortDescription' => 6, 'Description' => 7, 'ExpirationDate' => 8, 'IsCumulative' => 9, 'IsRemovingPostage' => 10, 'IsAvailableOnSpecialOffers' => 11, 'SerializedConditions' => 12, 'CreatedAt' => 13, 'UpdatedAt' => 14, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'code' => 2, 'type' => 3, 'amount' => 4, 'title' => 5, 'shortDescription' => 6, 'description' => 7, 'expirationDate' => 8, 'isCumulative' => 9, 'isRemovingPostage' => 10, 'isAvailableOnSpecialOffers' => 11, 'serializedConditions' => 12, 'createdAt' => 13, 'updatedAt' => 14, ), - self::TYPE_COLNAME => array(OrderCouponTableMap::ID => 0, OrderCouponTableMap::ORDER_ID => 1, OrderCouponTableMap::CODE => 2, OrderCouponTableMap::TYPE => 3, OrderCouponTableMap::AMOUNT => 4, OrderCouponTableMap::TITLE => 5, OrderCouponTableMap::SHORT_DESCRIPTION => 6, OrderCouponTableMap::DESCRIPTION => 7, OrderCouponTableMap::EXPIRATION_DATE => 8, OrderCouponTableMap::IS_CUMULATIVE => 9, OrderCouponTableMap::IS_REMOVING_POSTAGE => 10, OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS => 11, OrderCouponTableMap::SERIALIZED_CONDITIONS => 12, OrderCouponTableMap::CREATED_AT => 13, OrderCouponTableMap::UPDATED_AT => 14, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'CODE' => 2, 'TYPE' => 3, 'AMOUNT' => 4, 'TITLE' => 5, 'SHORT_DESCRIPTION' => 6, 'DESCRIPTION' => 7, 'EXPIRATION_DATE' => 8, 'IS_CUMULATIVE' => 9, 'IS_REMOVING_POSTAGE' => 10, 'IS_AVAILABLE_ON_SPECIAL_OFFERS' => 11, 'SERIALIZED_CONDITIONS' => 12, 'CREATED_AT' => 13, 'UPDATED_AT' => 14, ), - self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'code' => 2, 'type' => 3, 'amount' => 4, 'title' => 5, 'short_description' => 6, 'description' => 7, 'expiration_date' => 8, 'is_cumulative' => 9, 'is_removing_postage' => 10, 'is_available_on_special_offers' => 11, 'serialized_conditions' => 12, 'created_at' => 13, 'updated_at' => 14, ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ) + self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'Value' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'value' => 2, 'createdAt' => 3, 'updatedAt' => 4, ), + self::TYPE_COLNAME => array(CouponOrderTableMap::ID => 0, CouponOrderTableMap::ORDER_ID => 1, CouponOrderTableMap::VALUE => 2, CouponOrderTableMap::CREATED_AT => 3, CouponOrderTableMap::UPDATED_AT => 4, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'VALUE' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ), + self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'value' => 2, 'created_at' => 3, 'updated_at' => 4, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, ) ); /** @@ -189,25 +139,15 @@ class OrderCouponTableMap extends TableMap public function initialize() { // attributes - $this->setName('order_coupon'); - $this->setPhpName('OrderCoupon'); - $this->setClassName('\\Thelia\\Model\\OrderCoupon'); + $this->setName('coupon_order'); + $this->setPhpName('CouponOrder'); + $this->setClassName('\\Thelia\\Model\\CouponOrder'); $this->setPackage('Thelia.Model'); $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); $this->addForeignKey('ORDER_ID', 'OrderId', 'INTEGER', 'order', 'ID', true, null, null); - $this->addColumn('CODE', 'Code', 'VARCHAR', true, 45, null); - $this->addColumn('TYPE', 'Type', 'VARCHAR', true, 255, null); - $this->addColumn('AMOUNT', 'Amount', 'FLOAT', true, null, null); - $this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null); - $this->addColumn('SHORT_DESCRIPTION', 'ShortDescription', 'LONGVARCHAR', true, null, null); - $this->addColumn('DESCRIPTION', 'Description', 'CLOB', true, null, null); - $this->addColumn('EXPIRATION_DATE', 'ExpirationDate', 'TIMESTAMP', true, null, null); - $this->addColumn('IS_CUMULATIVE', 'IsCumulative', 'BOOLEAN', true, 1, null); - $this->addColumn('IS_REMOVING_POSTAGE', 'IsRemovingPostage', 'BOOLEAN', true, 1, null); - $this->addColumn('IS_AVAILABLE_ON_SPECIAL_OFFERS', 'IsAvailableOnSpecialOffers', 'BOOLEAN', true, 1, null); - $this->addColumn('SERIALIZED_CONDITIONS', 'SerializedConditions', 'LONGVARCHAR', true, null, null); + $this->addColumn('VALUE', 'Value', 'FLOAT', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -289,7 +229,7 @@ class OrderCouponTableMap extends TableMap */ public static function getOMClass($withPrefix = true) { - return $withPrefix ? OrderCouponTableMap::CLASS_DEFAULT : OrderCouponTableMap::OM_CLASS; + return $withPrefix ? CouponOrderTableMap::CLASS_DEFAULT : CouponOrderTableMap::OM_CLASS; } /** @@ -303,21 +243,21 @@ class OrderCouponTableMap extends TableMap * * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. - * @return array (OrderCoupon object, last column rank) + * @return array (CouponOrder object, last column rank) */ public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM) { - $key = OrderCouponTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType); - if (null !== ($obj = OrderCouponTableMap::getInstanceFromPool($key))) { + $key = CouponOrderTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType); + if (null !== ($obj = CouponOrderTableMap::getInstanceFromPool($key))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj->hydrate($row, $offset, true); // rehydrate - $col = $offset + OrderCouponTableMap::NUM_HYDRATE_COLUMNS; + $col = $offset + CouponOrderTableMap::NUM_HYDRATE_COLUMNS; } else { - $cls = OrderCouponTableMap::OM_CLASS; + $cls = CouponOrderTableMap::OM_CLASS; $obj = new $cls(); $col = $obj->hydrate($row, $offset, false, $indexType); - OrderCouponTableMap::addInstanceToPool($obj, $key); + CouponOrderTableMap::addInstanceToPool($obj, $key); } return array($obj, $col); @@ -340,8 +280,8 @@ class OrderCouponTableMap extends TableMap $cls = static::getOMClass(false); // populate the object(s) while ($row = $dataFetcher->fetch()) { - $key = OrderCouponTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType()); - if (null !== ($obj = OrderCouponTableMap::getInstanceFromPool($key))) { + $key = CouponOrderTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType()); + if (null !== ($obj = CouponOrderTableMap::getInstanceFromPool($key))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj->hydrate($row, 0, true); // rehydrate @@ -350,7 +290,7 @@ class OrderCouponTableMap extends TableMap $obj = new $cls(); $obj->hydrate($row); $results[] = $obj; - OrderCouponTableMap::addInstanceToPool($obj, $key); + CouponOrderTableMap::addInstanceToPool($obj, $key); } // if key exists } @@ -371,35 +311,15 @@ class OrderCouponTableMap extends TableMap public static function addSelectColumns(Criteria $criteria, $alias = null) { if (null === $alias) { - $criteria->addSelectColumn(OrderCouponTableMap::ID); - $criteria->addSelectColumn(OrderCouponTableMap::ORDER_ID); - $criteria->addSelectColumn(OrderCouponTableMap::CODE); - $criteria->addSelectColumn(OrderCouponTableMap::TYPE); - $criteria->addSelectColumn(OrderCouponTableMap::AMOUNT); - $criteria->addSelectColumn(OrderCouponTableMap::TITLE); - $criteria->addSelectColumn(OrderCouponTableMap::SHORT_DESCRIPTION); - $criteria->addSelectColumn(OrderCouponTableMap::DESCRIPTION); - $criteria->addSelectColumn(OrderCouponTableMap::EXPIRATION_DATE); - $criteria->addSelectColumn(OrderCouponTableMap::IS_CUMULATIVE); - $criteria->addSelectColumn(OrderCouponTableMap::IS_REMOVING_POSTAGE); - $criteria->addSelectColumn(OrderCouponTableMap::IS_AVAILABLE_ON_SPECIAL_OFFERS); - $criteria->addSelectColumn(OrderCouponTableMap::SERIALIZED_CONDITIONS); - $criteria->addSelectColumn(OrderCouponTableMap::CREATED_AT); - $criteria->addSelectColumn(OrderCouponTableMap::UPDATED_AT); + $criteria->addSelectColumn(CouponOrderTableMap::ID); + $criteria->addSelectColumn(CouponOrderTableMap::ORDER_ID); + $criteria->addSelectColumn(CouponOrderTableMap::VALUE); + $criteria->addSelectColumn(CouponOrderTableMap::CREATED_AT); + $criteria->addSelectColumn(CouponOrderTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ORDER_ID'); - $criteria->addSelectColumn($alias . '.CODE'); - $criteria->addSelectColumn($alias . '.TYPE'); - $criteria->addSelectColumn($alias . '.AMOUNT'); - $criteria->addSelectColumn($alias . '.TITLE'); - $criteria->addSelectColumn($alias . '.SHORT_DESCRIPTION'); - $criteria->addSelectColumn($alias . '.DESCRIPTION'); - $criteria->addSelectColumn($alias . '.EXPIRATION_DATE'); - $criteria->addSelectColumn($alias . '.IS_CUMULATIVE'); - $criteria->addSelectColumn($alias . '.IS_REMOVING_POSTAGE'); - $criteria->addSelectColumn($alias . '.IS_AVAILABLE_ON_SPECIAL_OFFERS'); - $criteria->addSelectColumn($alias . '.SERIALIZED_CONDITIONS'); + $criteria->addSelectColumn($alias . '.VALUE'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); } @@ -414,7 +334,7 @@ class OrderCouponTableMap extends TableMap */ public static function getTableMap() { - return Propel::getServiceContainer()->getDatabaseMap(OrderCouponTableMap::DATABASE_NAME)->getTable(OrderCouponTableMap::TABLE_NAME); + return Propel::getServiceContainer()->getDatabaseMap(CouponOrderTableMap::DATABASE_NAME)->getTable(CouponOrderTableMap::TABLE_NAME); } /** @@ -422,16 +342,16 @@ class OrderCouponTableMap extends TableMap */ public static function buildTableMap() { - $dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderCouponTableMap::DATABASE_NAME); - if (!$dbMap->hasTable(OrderCouponTableMap::TABLE_NAME)) { - $dbMap->addTableObject(new OrderCouponTableMap()); + $dbMap = Propel::getServiceContainer()->getDatabaseMap(CouponOrderTableMap::DATABASE_NAME); + if (!$dbMap->hasTable(CouponOrderTableMap::TABLE_NAME)) { + $dbMap->addTableObject(new CouponOrderTableMap()); } } /** - * Performs a DELETE on the database, given a OrderCoupon or Criteria object OR a primary key value. + * Performs a DELETE on the database, given a CouponOrder or Criteria object OR a primary key value. * - * @param mixed $values Criteria or OrderCoupon object or primary key or array of primary keys + * @param mixed $values Criteria or CouponOrder object or primary key or array of primary keys * which is used to create the DELETE statement * @param ConnectionInterface $con the connection to use * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows @@ -442,25 +362,25 @@ class OrderCouponTableMap extends TableMap public static function doDelete($values, ConnectionInterface $con = null) { if (null === $con) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); } if ($values instanceof Criteria) { // rename for clarity $criteria = $values; - } elseif ($values instanceof \Thelia\Model\OrderCoupon) { // it's a model object + } elseif ($values instanceof \Thelia\Model\CouponOrder) { // it's a model object // create criteria based on pk values $criteria = $values->buildPkeyCriteria(); } else { // it's a primary key, or an array of pks - $criteria = new Criteria(OrderCouponTableMap::DATABASE_NAME); - $criteria->add(OrderCouponTableMap::ID, (array) $values, Criteria::IN); + $criteria = new Criteria(CouponOrderTableMap::DATABASE_NAME); + $criteria->add(CouponOrderTableMap::ID, (array) $values, Criteria::IN); } - $query = OrderCouponQuery::create()->mergeWith($criteria); + $query = CouponOrderQuery::create()->mergeWith($criteria); - if ($values instanceof Criteria) { OrderCouponTableMap::clearInstancePool(); + if ($values instanceof Criteria) { CouponOrderTableMap::clearInstancePool(); } elseif (!is_object($values)) { // it's a primary key, or an array of pks - foreach ((array) $values as $singleval) { OrderCouponTableMap::removeInstanceFromPool($singleval); + foreach ((array) $values as $singleval) { CouponOrderTableMap::removeInstanceFromPool($singleval); } } @@ -468,20 +388,20 @@ class OrderCouponTableMap extends TableMap } /** - * Deletes all rows from the order_coupon table. + * Deletes all rows from the coupon_order table. * * @param ConnectionInterface $con the connection to use * @return int The number of affected rows (if supported by underlying database driver). */ public static function doDeleteAll(ConnectionInterface $con = null) { - return OrderCouponQuery::create()->doDeleteAll($con); + return CouponOrderQuery::create()->doDeleteAll($con); } /** - * Performs an INSERT on the database, given a OrderCoupon or Criteria object. + * Performs an INSERT on the database, given a CouponOrder or Criteria object. * - * @param mixed $criteria Criteria or OrderCoupon object containing data that is used to create the INSERT statement. + * @param mixed $criteria Criteria or CouponOrder object containing data that is used to create the INSERT statement. * @param ConnectionInterface $con the ConnectionInterface connection to use * @return mixed The new primary key. * @throws PropelException Any exceptions caught during processing will be @@ -490,22 +410,22 @@ class OrderCouponTableMap extends TableMap public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { - $con = Propel::getServiceContainer()->getWriteConnection(OrderCouponTableMap::DATABASE_NAME); + $con = Propel::getServiceContainer()->getWriteConnection(CouponOrderTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for clarity } else { - $criteria = $criteria->buildCriteria(); // build Criteria from OrderCoupon object + $criteria = $criteria->buildCriteria(); // build Criteria from CouponOrder object } - if ($criteria->containsKey(OrderCouponTableMap::ID) && $criteria->keyContainsValue(OrderCouponTableMap::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.OrderCouponTableMap::ID.')'); + if ($criteria->containsKey(CouponOrderTableMap::ID) && $criteria->keyContainsValue(CouponOrderTableMap::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CouponOrderTableMap::ID.')'); } // Set the correct dbName - $query = OrderCouponQuery::create()->mergeWith($criteria); + $query = CouponOrderQuery::create()->mergeWith($criteria); try { // use transaction because $criteria could contain info @@ -521,7 +441,7 @@ class OrderCouponTableMap extends TableMap return $pk; } -} // OrderCouponTableMap +} // CouponOrderTableMap // This is the static code needed to register the TableMap for this table with the main Propel class. // -OrderCouponTableMap::buildTableMap(); +CouponOrderTableMap::buildTableMap(); diff --git a/core/lib/Thelia/Model/Map/OrderTableMap.php b/core/lib/Thelia/Model/Map/OrderTableMap.php index fcf0ba70d..7daabb665 100644 --- a/core/lib/Thelia/Model/Map/OrderTableMap.php +++ b/core/lib/Thelia/Model/Map/OrderTableMap.php @@ -57,7 +57,7 @@ class OrderTableMap extends TableMap /** * The total number of columns */ - const NUM_COLUMNS = 19; + const NUM_COLUMNS = 18; /** * The number of lazy-loaded columns @@ -67,7 +67,7 @@ class OrderTableMap extends TableMap /** * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 19; + const NUM_HYDRATE_COLUMNS = 18; /** * the column name for the ID field @@ -124,11 +124,6 @@ class OrderTableMap extends TableMap */ const INVOICE_REF = 'order.INVOICE_REF'; - /** - * the column name for the DISCOUNT field - */ - const DISCOUNT = 'order.DISCOUNT'; - /** * the column name for the POSTAGE field */ @@ -176,12 +171,12 @@ class OrderTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'InvoiceOrderAddressId', 'DeliveryOrderAddressId', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'TransactionRef', 'DeliveryRef', 'InvoiceRef', 'Discount', 'Postage', 'PaymentModuleId', 'DeliveryModuleId', 'StatusId', 'LangId', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'invoiceOrderAddressId', 'deliveryOrderAddressId', 'invoiceDate', 'currencyId', 'currencyRate', 'transactionRef', 'deliveryRef', 'invoiceRef', 'discount', 'postage', 'paymentModuleId', 'deliveryModuleId', 'statusId', 'langId', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::INVOICE_ORDER_ADDRESS_ID, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION_REF, OrderTableMap::DELIVERY_REF, OrderTableMap::INVOICE_REF, OrderTableMap::DISCOUNT, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT_MODULE_ID, OrderTableMap::DELIVERY_MODULE_ID, OrderTableMap::STATUS_ID, OrderTableMap::LANG_ID, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'INVOICE_ORDER_ADDRESS_ID', 'DELIVERY_ORDER_ADDRESS_ID', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION_REF', 'DELIVERY_REF', 'INVOICE_REF', 'DISCOUNT', 'POSTAGE', 'PAYMENT_MODULE_ID', 'DELIVERY_MODULE_ID', 'STATUS_ID', 'LANG_ID', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'invoice_order_address_id', 'delivery_order_address_id', 'invoice_date', 'currency_id', 'currency_rate', 'transaction_ref', 'delivery_ref', 'invoice_ref', 'discount', 'postage', 'payment_module_id', 'delivery_module_id', 'status_id', 'lang_id', 'created_at', 'updated_at', ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ) + self::TYPE_PHPNAME => array('Id', 'Ref', 'CustomerId', 'InvoiceOrderAddressId', 'DeliveryOrderAddressId', 'InvoiceDate', 'CurrencyId', 'CurrencyRate', 'TransactionRef', 'DeliveryRef', 'InvoiceRef', 'Postage', 'PaymentModuleId', 'DeliveryModuleId', 'StatusId', 'LangId', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'customerId', 'invoiceOrderAddressId', 'deliveryOrderAddressId', 'invoiceDate', 'currencyId', 'currencyRate', 'transactionRef', 'deliveryRef', 'invoiceRef', 'postage', 'paymentModuleId', 'deliveryModuleId', 'statusId', 'langId', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(OrderTableMap::ID, OrderTableMap::REF, OrderTableMap::CUSTOMER_ID, OrderTableMap::INVOICE_ORDER_ADDRESS_ID, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID, OrderTableMap::INVOICE_DATE, OrderTableMap::CURRENCY_ID, OrderTableMap::CURRENCY_RATE, OrderTableMap::TRANSACTION_REF, OrderTableMap::DELIVERY_REF, OrderTableMap::INVOICE_REF, OrderTableMap::POSTAGE, OrderTableMap::PAYMENT_MODULE_ID, OrderTableMap::DELIVERY_MODULE_ID, OrderTableMap::STATUS_ID, OrderTableMap::LANG_ID, OrderTableMap::CREATED_AT, OrderTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CUSTOMER_ID', 'INVOICE_ORDER_ADDRESS_ID', 'DELIVERY_ORDER_ADDRESS_ID', 'INVOICE_DATE', 'CURRENCY_ID', 'CURRENCY_RATE', 'TRANSACTION_REF', 'DELIVERY_REF', 'INVOICE_REF', 'POSTAGE', 'PAYMENT_MODULE_ID', 'DELIVERY_MODULE_ID', 'STATUS_ID', 'LANG_ID', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'customer_id', 'invoice_order_address_id', 'delivery_order_address_id', 'invoice_date', 'currency_id', 'currency_rate', 'transaction_ref', 'delivery_ref', 'invoice_ref', 'postage', 'payment_module_id', 'delivery_module_id', 'status_id', 'lang_id', 'created_at', 'updated_at', ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) ); /** @@ -191,12 +186,12 @@ class OrderTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'InvoiceOrderAddressId' => 3, 'DeliveryOrderAddressId' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'TransactionRef' => 8, 'DeliveryRef' => 9, 'InvoiceRef' => 10, 'Discount' => 11, 'Postage' => 12, 'PaymentModuleId' => 13, 'DeliveryModuleId' => 14, 'StatusId' => 15, 'LangId' => 16, 'CreatedAt' => 17, 'UpdatedAt' => 18, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'invoiceOrderAddressId' => 3, 'deliveryOrderAddressId' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transactionRef' => 8, 'deliveryRef' => 9, 'invoiceRef' => 10, 'discount' => 11, 'postage' => 12, 'paymentModuleId' => 13, 'deliveryModuleId' => 14, 'statusId' => 15, 'langId' => 16, 'createdAt' => 17, 'updatedAt' => 18, ), - self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::INVOICE_ORDER_ADDRESS_ID => 3, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION_REF => 8, OrderTableMap::DELIVERY_REF => 9, OrderTableMap::INVOICE_REF => 10, OrderTableMap::DISCOUNT => 11, OrderTableMap::POSTAGE => 12, OrderTableMap::PAYMENT_MODULE_ID => 13, OrderTableMap::DELIVERY_MODULE_ID => 14, OrderTableMap::STATUS_ID => 15, OrderTableMap::LANG_ID => 16, OrderTableMap::CREATED_AT => 17, OrderTableMap::UPDATED_AT => 18, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'INVOICE_ORDER_ADDRESS_ID' => 3, 'DELIVERY_ORDER_ADDRESS_ID' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION_REF' => 8, 'DELIVERY_REF' => 9, 'INVOICE_REF' => 10, 'DISCOUNT' => 11, 'POSTAGE' => 12, 'PAYMENT_MODULE_ID' => 13, 'DELIVERY_MODULE_ID' => 14, 'STATUS_ID' => 15, 'LANG_ID' => 16, 'CREATED_AT' => 17, 'UPDATED_AT' => 18, ), - self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'invoice_order_address_id' => 3, 'delivery_order_address_id' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction_ref' => 8, 'delivery_ref' => 9, 'invoice_ref' => 10, 'discount' => 11, 'postage' => 12, 'payment_module_id' => 13, 'delivery_module_id' => 14, 'status_id' => 15, 'lang_id' => 16, 'created_at' => 17, 'updated_at' => 18, ), - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ) + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CustomerId' => 2, 'InvoiceOrderAddressId' => 3, 'DeliveryOrderAddressId' => 4, 'InvoiceDate' => 5, 'CurrencyId' => 6, 'CurrencyRate' => 7, 'TransactionRef' => 8, 'DeliveryRef' => 9, 'InvoiceRef' => 10, 'Postage' => 11, 'PaymentModuleId' => 12, 'DeliveryModuleId' => 13, 'StatusId' => 14, 'LangId' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'customerId' => 2, 'invoiceOrderAddressId' => 3, 'deliveryOrderAddressId' => 4, 'invoiceDate' => 5, 'currencyId' => 6, 'currencyRate' => 7, 'transactionRef' => 8, 'deliveryRef' => 9, 'invoiceRef' => 10, 'postage' => 11, 'paymentModuleId' => 12, 'deliveryModuleId' => 13, 'statusId' => 14, 'langId' => 15, 'createdAt' => 16, 'updatedAt' => 17, ), + self::TYPE_COLNAME => array(OrderTableMap::ID => 0, OrderTableMap::REF => 1, OrderTableMap::CUSTOMER_ID => 2, OrderTableMap::INVOICE_ORDER_ADDRESS_ID => 3, OrderTableMap::DELIVERY_ORDER_ADDRESS_ID => 4, OrderTableMap::INVOICE_DATE => 5, OrderTableMap::CURRENCY_ID => 6, OrderTableMap::CURRENCY_RATE => 7, OrderTableMap::TRANSACTION_REF => 8, OrderTableMap::DELIVERY_REF => 9, OrderTableMap::INVOICE_REF => 10, OrderTableMap::POSTAGE => 11, OrderTableMap::PAYMENT_MODULE_ID => 12, OrderTableMap::DELIVERY_MODULE_ID => 13, OrderTableMap::STATUS_ID => 14, OrderTableMap::LANG_ID => 15, OrderTableMap::CREATED_AT => 16, OrderTableMap::UPDATED_AT => 17, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CUSTOMER_ID' => 2, 'INVOICE_ORDER_ADDRESS_ID' => 3, 'DELIVERY_ORDER_ADDRESS_ID' => 4, 'INVOICE_DATE' => 5, 'CURRENCY_ID' => 6, 'CURRENCY_RATE' => 7, 'TRANSACTION_REF' => 8, 'DELIVERY_REF' => 9, 'INVOICE_REF' => 10, 'POSTAGE' => 11, 'PAYMENT_MODULE_ID' => 12, 'DELIVERY_MODULE_ID' => 13, 'STATUS_ID' => 14, 'LANG_ID' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'customer_id' => 2, 'invoice_order_address_id' => 3, 'delivery_order_address_id' => 4, 'invoice_date' => 5, 'currency_id' => 6, 'currency_rate' => 7, 'transaction_ref' => 8, 'delivery_ref' => 9, 'invoice_ref' => 10, 'postage' => 11, 'payment_module_id' => 12, 'delivery_module_id' => 13, 'status_id' => 14, 'lang_id' => 15, 'created_at' => 16, 'updated_at' => 17, ), + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) ); /** @@ -226,7 +221,6 @@ class OrderTableMap extends TableMap $this->addColumn('TRANSACTION_REF', 'TransactionRef', 'VARCHAR', false, 100, null); $this->addColumn('DELIVERY_REF', 'DeliveryRef', 'VARCHAR', false, 100, null); $this->addColumn('INVOICE_REF', 'InvoiceRef', 'VARCHAR', false, 100, null); - $this->addColumn('DISCOUNT', 'Discount', 'FLOAT', false, null, null); $this->addColumn('POSTAGE', 'Postage', 'FLOAT', true, null, null); $this->addForeignKey('PAYMENT_MODULE_ID', 'PaymentModuleId', 'INTEGER', 'module', 'ID', true, null, null); $this->addForeignKey('DELIVERY_MODULE_ID', 'DeliveryModuleId', 'INTEGER', 'module', 'ID', true, null, null); @@ -250,7 +244,7 @@ class OrderTableMap extends TableMap $this->addRelation('ModuleRelatedByDeliveryModuleId', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('delivery_module_id' => 'id', ), 'RESTRICT', 'RESTRICT'); $this->addRelation('Lang', '\\Thelia\\Model\\Lang', RelationMap::MANY_TO_ONE, array('lang_id' => 'id', ), 'RESTRICT', 'RESTRICT'); $this->addRelation('OrderProduct', '\\Thelia\\Model\\OrderProduct', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'OrderProducts'); - $this->addRelation('OrderCoupon', '\\Thelia\\Model\\OrderCoupon', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'OrderCoupons'); + $this->addRelation('CouponOrder', '\\Thelia\\Model\\CouponOrder', RelationMap::ONE_TO_MANY, array('id' => 'order_id', ), 'CASCADE', 'RESTRICT', 'CouponOrders'); } // buildRelations() /** @@ -273,7 +267,7 @@ class OrderTableMap extends TableMap // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. OrderProductTableMap::clearInstancePool(); - OrderCouponTableMap::clearInstancePool(); + CouponOrderTableMap::clearInstancePool(); } /** @@ -425,7 +419,6 @@ class OrderTableMap extends TableMap $criteria->addSelectColumn(OrderTableMap::TRANSACTION_REF); $criteria->addSelectColumn(OrderTableMap::DELIVERY_REF); $criteria->addSelectColumn(OrderTableMap::INVOICE_REF); - $criteria->addSelectColumn(OrderTableMap::DISCOUNT); $criteria->addSelectColumn(OrderTableMap::POSTAGE); $criteria->addSelectColumn(OrderTableMap::PAYMENT_MODULE_ID); $criteria->addSelectColumn(OrderTableMap::DELIVERY_MODULE_ID); @@ -445,7 +438,6 @@ class OrderTableMap extends TableMap $criteria->addSelectColumn($alias . '.TRANSACTION_REF'); $criteria->addSelectColumn($alias . '.DELIVERY_REF'); $criteria->addSelectColumn($alias . '.INVOICE_REF'); - $criteria->addSelectColumn($alias . '.DISCOUNT'); $criteria->addSelectColumn($alias . '.POSTAGE'); $criteria->addSelectColumn($alias . '.PAYMENT_MODULE_ID'); $criteria->addSelectColumn($alias . '.DELIVERY_MODULE_ID'); diff --git a/core/lib/Thelia/Model/Order.php b/core/lib/Thelia/Model/Order.php index 56abca4cc..d761c3959 100755 --- a/core/lib/Thelia/Model/Order.php +++ b/core/lib/Thelia/Model/Order.php @@ -55,7 +55,7 @@ class Order extends BaseOrder * * @return float|int|string */ - public function getTotalAmount(&$tax = 0, $includePostage = true, $includeDiscount = true) + public function getTotalAmount(&$tax = 0, $includePostage = true) { $amount = 0; $tax = 0; @@ -79,21 +79,177 @@ class Order extends BaseOrder $total = $amount + $tax; - // @todo : manage discount : free postage ? - if(true === $includeDiscount) { - $total -= $this->getDiscount(); - - if($total<0) { - $total = 0; - } else { - $total = round($total, 2); - } - } - if(false !== $includePostage) { $total += $this->getPostage(); } - return $total; + return $total; // @todo : manage discount + } + + /** + * PROPEL SHOULD FIX IT + * + * Insert the row in the database. + * + * @param ConnectionInterface $con + * + * @throws PropelException + * @see doSave() + */ + protected function doInsert(ConnectionInterface $con) + { + $modifiedColumns = array(); + $index = 0; + + $this->modifiedColumns[] = OrderTableMap::ID; + if (null !== $this->id) { + throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrderTableMap::ID . ')'); + } + + // check the columns in natural order for more readable SQL queries + if ($this->isColumnModified(OrderTableMap::ID)) { + $modifiedColumns[':p' . $index++] = 'ID'; + } + if ($this->isColumnModified(OrderTableMap::REF)) { + $modifiedColumns[':p' . $index++] = 'REF'; + } + if ($this->isColumnModified(OrderTableMap::CUSTOMER_ID)) { + $modifiedColumns[':p' . $index++] = 'CUSTOMER_ID'; + } + if ($this->isColumnModified(OrderTableMap::INVOICE_ORDER_ADDRESS_ID)) { + $modifiedColumns[':p' . $index++] = 'INVOICE_ORDER_ADDRESS_ID'; + } + if ($this->isColumnModified(OrderTableMap::DELIVERY_ORDER_ADDRESS_ID)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_ORDER_ADDRESS_ID'; + } + if ($this->isColumnModified(OrderTableMap::INVOICE_DATE)) { + $modifiedColumns[':p' . $index++] = 'INVOICE_DATE'; + } + if ($this->isColumnModified(OrderTableMap::CURRENCY_ID)) { + $modifiedColumns[':p' . $index++] = 'CURRENCY_ID'; + } + if ($this->isColumnModified(OrderTableMap::CURRENCY_RATE)) { + $modifiedColumns[':p' . $index++] = 'CURRENCY_RATE'; + } + if ($this->isColumnModified(OrderTableMap::TRANSACTION_REF)) { + $modifiedColumns[':p' . $index++] = 'TRANSACTION_REF'; + } + if ($this->isColumnModified(OrderTableMap::DELIVERY_REF)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_REF'; + } + if ($this->isColumnModified(OrderTableMap::INVOICE_REF)) { + $modifiedColumns[':p' . $index++] = 'INVOICE_REF'; + } + if ($this->isColumnModified(OrderTableMap::POSTAGE)) { + $modifiedColumns[':p' . $index++] = 'POSTAGE'; + } + if ($this->isColumnModified(OrderTableMap::PAYMENT_MODULE_ID)) { + $modifiedColumns[':p' . $index++] = 'PAYMENT_MODULE_ID'; + } + if ($this->isColumnModified(OrderTableMap::DELIVERY_MODULE_ID)) { + $modifiedColumns[':p' . $index++] = 'DELIVERY_MODULE_ID'; + } + if ($this->isColumnModified(OrderTableMap::STATUS_ID)) { + $modifiedColumns[':p' . $index++] = 'STATUS_ID'; + } + if ($this->isColumnModified(OrderTableMap::LANG_ID)) { + $modifiedColumns[':p' . $index++] = 'LANG_ID'; + } + if ($this->isColumnModified(OrderTableMap::CREATED_AT)) { + $modifiedColumns[':p' . $index++] = 'CREATED_AT'; + } + if ($this->isColumnModified(OrderTableMap::UPDATED_AT)) { + $modifiedColumns[':p' . $index++] = 'UPDATED_AT'; + } + + $db = Propel::getServiceContainer()->getAdapter(OrderTableMap::DATABASE_NAME); + + if ($db->useQuoteIdentifier()) { + $tableName = $db->quoteIdentifierTable(OrderTableMap::TABLE_NAME); + } else { + $tableName = OrderTableMap::TABLE_NAME; + } + + $sql = sprintf( + 'INSERT INTO %s (%s) VALUES (%s)', + $tableName, + implode(', ', $modifiedColumns), + implode(', ', array_keys($modifiedColumns)) + ); + + try { + $stmt = $con->prepare($sql); + foreach ($modifiedColumns as $identifier => $columnName) { + switch ($columnName) { + case 'ID': + $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); + break; + case 'REF': + $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); + break; + case 'CUSTOMER_ID': + $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT); + break; + case 'INVOICE_ORDER_ADDRESS_ID': + $stmt->bindValue($identifier, $this->invoice_order_address_id, PDO::PARAM_INT); + break; + case 'DELIVERY_ORDER_ADDRESS_ID': + $stmt->bindValue($identifier, $this->delivery_order_address_id, PDO::PARAM_INT); + break; + case 'INVOICE_DATE': + $stmt->bindValue($identifier, $this->invoice_date ? $this->invoice_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); + break; + case 'CURRENCY_ID': + $stmt->bindValue($identifier, $this->currency_id, PDO::PARAM_INT); + break; + case 'CURRENCY_RATE': + $stmt->bindValue($identifier, $this->currency_rate, PDO::PARAM_STR); + break; + case 'TRANSACTION_REF': + $stmt->bindValue($identifier, $this->transaction_ref, PDO::PARAM_STR); + break; + case 'DELIVERY_REF': + $stmt->bindValue($identifier, $this->delivery_ref, PDO::PARAM_STR); + break; + case 'INVOICE_REF': + $stmt->bindValue($identifier, $this->invoice_ref, PDO::PARAM_STR); + break; + case 'POSTAGE': + $stmt->bindValue($identifier, $this->postage, PDO::PARAM_STR); + break; + case 'PAYMENT_MODULE_ID': + $stmt->bindValue($identifier, $this->payment_module_id, PDO::PARAM_INT); + break; + case 'DELIVERY_MODULE_ID': + $stmt->bindValue($identifier, $this->delivery_module_id, PDO::PARAM_INT); + break; + case 'STATUS_ID': + $stmt->bindValue($identifier, $this->status_id, PDO::PARAM_INT); + break; + case 'LANG_ID': + $stmt->bindValue($identifier, $this->lang_id, PDO::PARAM_INT); + break; + case 'CREATED_AT': + $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); + break; + case 'UPDATED_AT': + $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR); + break; + } + } + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e); + } + + try { + $pk = $con->lastInsertId(); + } catch (Exception $e) { + throw new PropelException('Unable to get autoincrement id.', 0, $e); + } + $this->setId($pk); + + $this->setNew(false); } } diff --git a/core/lib/Thelia/Model/OrderCoupon.php b/core/lib/Thelia/Model/OrderCoupon.php deleted file mode 100644 index 558496813..000000000 --- a/core/lib/Thelia/Model/OrderCoupon.php +++ /dev/null @@ -1,10 +0,0 @@ -prepare($sql); + $stmt->bindValue(':p0', $key, PDO::PARAM_INT); + $stmt->execute(); + } catch (\Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); + } + $obj = null; + if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { + $obj = new Order(); + $obj->hydrate($row); + OrderTableMap::addInstanceToPool($obj, (string) $key); + } + $stmt->closeCursor(); + + return $obj; + } + public static function getMonthlySaleStats($month, $year) { $numberOfDay = cal_days_in_month(CAL_GREGORIAN, $month, $year); diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php index 7a29c7e6a..4575f5aac 100755 --- a/core/lib/Thelia/Module/BaseModule.php +++ b/core/lib/Thelia/Module/BaseModule.php @@ -39,6 +39,7 @@ use Thelia\Model\Module; use Thelia\Model\ModuleImage; use Thelia\Model\ModuleQuery; + class BaseModule extends ContainerAware implements BaseModuleInterface { const CLASSIC_MODULE_TYPE = 1; @@ -114,18 +115,16 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->container; } - public function hasRequest() - { + + public function hasRequest() { return null !== $this->request; } - public function setRequest(Request $request) - { + public function setRequest(Request $request) { $this->request = $request; } - public function getRequest() - { + public function getRequest() { if ($this->hasRequest() === false) { throw new \RuntimeException("Sorry, the request is not available in this context"); } @@ -133,18 +132,16 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->request; } - public function hasDispatcher() - { + + public function hasDispatcher() { return null !== $this->dispatcher; } - public function setDispatcher(EventDispatcherInterface $dispatcher) - { + public function setDispatcher(EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; } - public function getDispatcher() - { + public function getDispatcher() { if ($this->hasDispatcher() === false) { throw new \RuntimeException("Sorry, the dispatcher is not available in this context"); } @@ -152,6 +149,7 @@ class BaseModule extends ContainerAware implements BaseModuleInterface return $this->dispatcher; } + public function setTitle(Module $module, $titles) { if (is_array($titles)) { @@ -291,4 +289,4 @@ class BaseModule extends ContainerAware implements BaseModuleInterface { // Implement this method to do something useful. } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Module/BaseModuleInterface.php b/core/lib/Thelia/Module/BaseModuleInterface.php index be7b30a12..694a4082c 100644 --- a/core/lib/Thelia/Module/BaseModuleInterface.php +++ b/core/lib/Thelia/Module/BaseModuleInterface.php @@ -24,6 +24,8 @@ namespace Thelia\Module; use Propel\Runtime\Connection\ConnectionInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\HttpFoundation\Request; interface BaseModuleInterface { diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php index 1eca7d2ea..8db9c08dc 100644 --- a/core/lib/Thelia/Tests/Action/ContentTest.php +++ b/core/lib/Thelia/Tests/Action/ContentTest.php @@ -47,7 +47,7 @@ class ContentTest extends TestCaseWithURLToolSetup public function getUpdateEvent(&$content) { - if (!$content instanceof \Thelia\Model\Content) { + if(!$content instanceof \Thelia\Model\Content) { $content = $this->getRandomContent(); } diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php index cbf9a7c1e..83eebc93c 100644 --- a/core/lib/Thelia/Tests/Action/FolderTest.php +++ b/core/lib/Thelia/Tests/Action/FolderTest.php @@ -45,7 +45,7 @@ class FolderTest extends TestCaseWithURLToolSetup public function getUpdateEvent(&$folder) { - if (!$folder instanceof \Thelia\Model\Folder) { + if(!$folder instanceof \Thelia\Model\Folder) { $folder = $this->getRandomFolder(); } @@ -65,7 +65,7 @@ class FolderTest extends TestCaseWithURLToolSetup public function getUpdateSeoEvent(&$folder) { - if (!$folder instanceof \Thelia\Model\Folder) { + if(!$folder instanceof \Thelia\Model\Folder) { $folder = $this->getRandomFolder(); } @@ -83,7 +83,6 @@ class FolderTest extends TestCaseWithURLToolSetup public function processUpdateSeoAction($event) { $contentAction = new Folder($this->getContainer()); - return $contentAction->updateSeo($event); } @@ -224,7 +223,7 @@ class FolderTest extends TestCaseWithURLToolSetup ->findOne(); if (null === $nextFolder) { - $this->fail('use fixtures before launching test, there is not enough folder in database'); + $this->fail('use fixtures before launching test, there is no folder in database'); } $folder = FolderQuery::create() diff --git a/core/lib/Thelia/Tests/Action/OrderTest.php b/core/lib/Thelia/Tests/Action/OrderTest.php index f2fd00a32..64a92fd40 100644 --- a/core/lib/Thelia/Tests/Action/OrderTest.php +++ b/core/lib/Thelia/Tests/Action/OrderTest.php @@ -24,6 +24,7 @@ namespace Thelia\Tests\Action; use Propel\Runtime\ActiveQuery\Criteria; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Thelia\Core\Event\Order\OrderAddressEvent; use Thelia\Core\Event\Order\OrderEvent; diff --git a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php index 3d5e757d1..8b5c30398 100644 --- a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php +++ b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php @@ -37,7 +37,7 @@ trait RewrittenUrlTestTrait ->filterByView(ConfigQuery::getObsoleteRewrittenUrlView(), Criteria::NOT_EQUAL) ->findOne(); - if (null === $existingUrl) { + if(null === $existingUrl) { $this->fail('use fixtures before launching test, there is not enough rewritten url'); } @@ -55,12 +55,12 @@ trait RewrittenUrlTestTrait /* get a brand new URL */ $exist = true; - while (true === $exist) { + while(true === $exist) { $newUrl = md5(rand(1, 999999)) . ".html"; try { new RewritingResolver($newUrl); - } catch (UrlRewritingException $e) { - if ($e->getCode() === UrlRewritingException::URL_NOT_FOUND) { + } catch(UrlRewritingException $e) { + if($e->getCode() === UrlRewritingException::URL_NOT_FOUND) { /* It's all good if URL is not found */ $exist = false; } else { @@ -91,9 +91,9 @@ trait RewrittenUrlTestTrait try { $aRandomProduct->setRewrittenUrl($aRandomProduct->getLocale(), $currentUrl); $failReassign = false; - } catch (\Exception $e) { + } catch(\Exception $e) { } $this->assertFalse($failReassign); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php index de715e499..46f639521 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionCollectionTest.php @@ -52,6 +52,7 @@ class ConditionCollectionTest extends \PHPUnit_Framework_TestCase { } + /** * Generate adapter stub * diff --git a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php index 824592f77..37fde4cea 100644 --- a/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php +++ b/core/lib/Thelia/Tests/Condition/ConditionFactoryTest.php @@ -431,10 +431,12 @@ class ConditionFactoryTest extends \PHPUnit_Framework_TestCase ->method('getContainer') ->will($this->returnValue($stubContainer)); + $conditions = new ConditionCollection(); $conditionFactory = new ConditionFactory($stubContainer); + $conditionNone = new MatchForEveryone($stubFacade); $expectedCollection = new ConditionCollection(); $expectedCollection->add($conditionNone); diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php index c7e15af87..f59fe04ef 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneTest.php @@ -197,5 +197,6 @@ class MatchForEveryoneTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expected1, $actual1); $this->assertEquals($expected2, $actual2); + } } diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php index 1c61ed1f2..d28bf198d 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php @@ -633,6 +633,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -643,6 +644,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'UNK'); $condition1->setValidatorsFromForm($operators, $values); + $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); @@ -698,6 +700,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -708,6 +711,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'EUR'); $condition1->setValidatorsFromForm($operators, $values); + $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); @@ -763,6 +767,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->method('getAvailableCurrencies') ->will($this->returnValue($currencies)); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::EQUAL, @@ -773,6 +778,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase MatchForTotalAmount::INPUT2 => 'EUR'); $condition1->setValidatorsFromForm($operators, $values); + $stubContainer = $this->getMockBuilder('\Symfony\Component\DependencyInjection\Container') ->disableOriginalConstructor() ->getMock(); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php index ac371e71f..c4bf8f3a6 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/CategoryTest.php @@ -53,7 +53,7 @@ class CategoryTest extends BaseLoopTestor public function testSearchById() { $category = CategoryQuery::create()->findOne(); - if (null === $category) { + if(null === $category) { $category = new \Thelia\Model\Category(); $category->setParent(0); $category->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php index 0009b90d8..3d5329a66 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ContentTest.php @@ -53,7 +53,7 @@ class ContentTest extends BaseLoopTestor public function testSearchById() { $content = ContentQuery::create()->findOne(); - if (null === $content) { + if(null === $content) { $content = new \Thelia\Model\Content(); $content->setDefaultFolder(0); $content->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php index 0dd3b6b0d..87c078e16 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/FolderTest.php @@ -53,7 +53,7 @@ class FolderTest extends BaseLoopTestor public function testSearchById() { $folder = FolderQuery::create()->findOne(); - if (null === $folder) { + if(null === $folder) { $folder = new \Thelia\Model\Folder(); $folder->setParent(0); $folder->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php index b071bde9c..66081caa5 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/ProductTest.php @@ -54,7 +54,7 @@ class ProductTest extends BaseLoopTestor public function testSearchById() { $product = ProductQuery::create()->orderById(Criteria::ASC)->findOne(); - if (null === $product) { + if(null === $product) { $product = new \Thelia\Model\Product(); $product->setDefaultCategory(0); $product->setVisible(1); diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php index dd42a343e..7e2da4b26 100644 --- a/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/TaxRuleTest.php @@ -53,7 +53,7 @@ class TaxRuleTest extends BaseLoopTestor public function testSearchById() { $tr = TaxRuleQuery::create()->findOne(); - if (null === $tr) { + if(null === $tr) { $tr = new \Thelia\Model\TaxRule(); $tr->setTitle('foo'); $tr->save(); diff --git a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php index b5d073c87..b70bdf247 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php @@ -156,6 +156,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $serializedConditions = $conditionFactory->serializeConditionCollection($conditions); $coupon1->setSerializedConditions($serializedConditions); + $coupon1->setMaxUsage(40); $coupon1->setIsCumulative(true); $coupon1->setIsRemovingPostage(false); @@ -189,6 +190,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -221,6 +223,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); + $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); @@ -252,6 +255,8 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); + + $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager)); @@ -288,6 +293,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -320,6 +326,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); + $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); @@ -351,6 +358,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponManager = new RemoveXAmount($stubFacade); + $condition1 = new MatchForTotalAmount($stubFacade); $operators = array( MatchForTotalAmount::INPUT1 => Operators::SUPERIOR, @@ -381,6 +389,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('unserializeConditionCollection') ->will($this->returnValue($conditions)); + $stubContainer->expects($this->any()) ->method('get') ->will($this->onConsecutiveCalls($stubFacade, $couponManager, $stubConditionFactory)); diff --git a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php index bda8275e6..bf4b9f1e9 100644 --- a/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php +++ b/core/lib/Thelia/Tests/Coupon/CouponManagerTest.php @@ -62,6 +62,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase { } + /** * Generate a valid Coupon model */ @@ -117,6 +118,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $serializedConditions = $conditionFactory->serializeConditionCollection($conditions); $coupon1->setSerializedConditions($serializedConditions); + $coupon1->setMaxUsage(40); $coupon1->setIsCumulative(true); $coupon1->setIsRemovingPostage(true); @@ -156,7 +158,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $couponFactory = new CouponFactory($stubContainer); $model1 = $this->generateCouponModel($stubFacade, $conditionFactory); - $model1->setCode('XMAS')->setIsRemovingPostage(false)->setAmount(21.00); + $model1->setAmount(21.00); $coupon1 = $couponFactory->buildCouponFromModel($model1); $model2 = $this->generateCouponModel($stubFacade, $conditionFactory); @@ -174,16 +176,12 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->will($this->returnValue(122.53)); $couponManager = new CouponManager($stubContainer); - $couponManager->addAvailableCoupon($coupon1); - $couponManager->addAvailableCoupon($coupon2); - $actual = $couponManager->getDiscount(); - $expected = 21 + 21.50; + $expected = 50.80; $this->assertEquals($expected, $actual); - $this->assertTrue($couponManager->isCouponRemovingPostage()); } /** @@ -309,6 +307,8 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $conditionFactory = new ConditionFactory($stubContainer); + + $stubFacade->expects($this->any()) ->method('getCurrentCoupons') ->will($this->returnValue(array())); @@ -334,6 +334,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua $coupon1 = $couponFactory->buildCouponFromModel($model1); $coupon2 = clone $coupon1; + $couponManager = new CouponManager($stubContainer); $couponManager->addAvailableCoupon($coupon1); $couponManager->addAvailableCoupon($coupon2); @@ -386,6 +387,7 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); + $couponManager = new CouponManager($stubContainer); $couponManager->addAvailableCondition($condition1); $couponManager->addAvailableCondition($condition2); @@ -442,8 +444,10 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); + $couponManager = new CouponManager($stubContainer); + $stubModel = $this->getMockBuilder('\Thelia\Model\Coupon') ->disableOriginalConstructor() ->getMock(); @@ -507,8 +511,10 @@ Sed facilisis pellentesque nisl, eu tincidunt erat scelerisque a. Nullam malesua ->method('get') ->will($this->onConsecutiveCalls($stubFacade)); + $couponManager = new CouponManager($stubContainer); + $stubModel = $this->getMockBuilder('\Thelia\Model\Coupon') ->disableOriginalConstructor() ->getMock(); diff --git a/core/lib/Thelia/Tests/Model/Message.php b/core/lib/Thelia/Tests/Model/Message.php index 661ec68e0..1b7cd5716 100644 --- a/core/lib/Thelia/Tests/Model/Message.php +++ b/core/lib/Thelia/Tests/Model/Message.php @@ -23,6 +23,7 @@ namespace Thelia\Tests\Model; + use Thelia\Model\ConfigQuery; use Symfony\Component\Filesystem\Filesystem; use Thelia\Model\Message; @@ -323,8 +324,8 @@ class MessageTest extends \PHPUnit_Framework_TestCase $this->assertEquals("TEXT Layout 6: TEXT