Merge branch 'master' of github.com:thelia/thelia into cleanmaster
This commit is contained in:
@@ -30,7 +30,6 @@ use Thelia\Core\Event\UpdateSeoEvent;
|
||||
|
||||
use Thelia\Exception\UrlRewritingException;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use \Thelia\Model\Tools\UrlRewritingTrait;
|
||||
|
||||
class BaseAction
|
||||
{
|
||||
@@ -82,8 +81,8 @@ class BaseAction
|
||||
/**
|
||||
* Changes SEO Fields for an object.
|
||||
*
|
||||
* @param ModelCriteria $query
|
||||
* @param UpdateSeoEvent $event
|
||||
* @param ModelCriteria $query
|
||||
* @param UpdateSeoEvent $event
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -105,7 +104,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());
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,6 @@ class Coupon extends BaseAction implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$event->setIsValid($isValid);
|
||||
$event->setDiscount($totalDiscount);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -281,7 +281,7 @@ class Order extends BaseAction implements EventSubscriberInterface
|
||||
$sessionOrder = new \Thelia\Model\Order();
|
||||
$event->setOrder($sessionOrder);
|
||||
$event->setPlacedOrder($placedOrder);
|
||||
$this->getSession()->setOrder($sessionOrder);
|
||||
$this->getSession()->setOrder($placedOrder);
|
||||
|
||||
/* empty cart */
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest())));
|
||||
@@ -298,7 +298,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')
|
||||
|
||||
@@ -131,7 +131,6 @@ class Product extends BaseAction implements EventSubscriberInterface
|
||||
return $this->genericUpdateSeo(ProductQuery::create(), $event);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a product entry
|
||||
*
|
||||
|
||||
@@ -209,8 +209,7 @@ 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()
|
||||
@@ -238,8 +237,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();
|
||||
@@ -252,7 +251,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(
|
||||
@@ -276,8 +275,7 @@ class ProductSaleElement extends BaseAction implements EventSubscriberInterface
|
||||
|
||||
// Store all the stuff !
|
||||
$con->commit();
|
||||
}
|
||||
catch (\Exception $ex) {
|
||||
} catch (\Exception $ex) {
|
||||
|
||||
$con->rollback();
|
||||
|
||||
@@ -288,9 +286,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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user