Working cleaning
This commit is contained in:
@@ -29,7 +29,6 @@ use Symfony\Component\Translation\Translator;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Thelia\Condition\ConditionEvaluator;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Coupon\Type\CouponInterface;
|
||||
use Thelia\Model\Coupon;
|
||||
use Thelia\Model\CouponQuery;
|
||||
use Thelia\Cart\CartTrait;
|
||||
@@ -45,7 +44,6 @@ use Thelia\Model\CurrencyQuery;
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
* @todo implements
|
||||
*
|
||||
*/
|
||||
class BaseFacade implements FacadeInterface
|
||||
@@ -87,7 +85,7 @@ class BaseFacade implements FacadeInterface
|
||||
*/
|
||||
public function getDeliveryAddress()
|
||||
{
|
||||
// TODO: Implement getDeliveryAddress() method.
|
||||
// @todo: Implement getDeliveryAddress() method.
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,34 +187,7 @@ class BaseFacade implements FacadeInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a Coupon in the database
|
||||
*
|
||||
* @param CouponInterface $coupon Coupon
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function saveCoupon(CouponInterface $coupon)
|
||||
{
|
||||
// $couponModel = new Coupon();
|
||||
// $couponModel->setCode($coupon->getCode());
|
||||
// $couponModel->setType(get_class($coupon));
|
||||
// $couponModel->setTitle($coupon->getTitle());
|
||||
// $couponModel->setShortDescription($coupon->getShortDescription());
|
||||
// $couponModel->setDescription($coupon->getDescription());
|
||||
// $couponModel->setAmount($coupon->getDiscount());
|
||||
// $couponModel->setIsUsed(0);
|
||||
// $couponModel->setIsEnabled(1);
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
// $couponModel->set
|
||||
}
|
||||
|
||||
/**
|
||||
* Return plateform Container
|
||||
* Return platform Container
|
||||
*
|
||||
* @return Container
|
||||
*/
|
||||
|
||||
@@ -183,39 +183,12 @@ class CouponManager
|
||||
$discount = 0.00;
|
||||
/** @var CouponInterface $coupon */
|
||||
foreach ($coupons as $coupon) {
|
||||
// @todo modify Cart with discount for each cart item
|
||||
$discount += $coupon->exec($this->adapter);
|
||||
}
|
||||
|
||||
return $discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a ConditionManagerInterface from data coming from a form
|
||||
*
|
||||
* @param string $conditionServiceId Condition service id you want to instantiate
|
||||
* @param array $operators Condition Operator set by the Admin
|
||||
* @param array $values Condition Values set by the Admin
|
||||
*
|
||||
* @return ConditionManagerInterface
|
||||
*/
|
||||
public function buildRuleFromForm($conditionServiceId, array $operators, array $values)
|
||||
{
|
||||
$condition = false;
|
||||
try {
|
||||
|
||||
if ($this->container->has($conditionServiceId)) {
|
||||
/** @var ConditionManagerInterface $condition */
|
||||
$condition = $this->container->get($conditionServiceId);
|
||||
$condition->populateFromForm($operators, $values);
|
||||
}
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
|
||||
}
|
||||
|
||||
return $condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an available CouponManager (Services)
|
||||
*
|
||||
|
||||
@@ -28,7 +28,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Thelia\Condition\ConditionEvaluator;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Coupon\Type\CouponInterface;
|
||||
use Thelia\Model\Coupon;
|
||||
|
||||
/**
|
||||
@@ -125,15 +124,6 @@ interface FacadeInterface
|
||||
*/
|
||||
public function findOneCouponByCode($code);
|
||||
|
||||
/**
|
||||
* Save a Coupon in the database
|
||||
*
|
||||
* @param CouponInterface $coupon Coupon
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function saveCoupon(CouponInterface $coupon);
|
||||
|
||||
/**
|
||||
* Return platform Container
|
||||
*
|
||||
|
||||
@@ -45,7 +45,7 @@ class RuleOrganizer implements RuleOrganizerInterface
|
||||
*/
|
||||
public function organize(array $conditions)
|
||||
{
|
||||
// TODO: Implement organize() method.
|
||||
// @todo: Implement organize() method.
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user