Coupon : Condition module refactor

Less crappy unmaintainable javascript
More logic in extendable php
This commit is contained in:
gmorel
2014-01-05 00:00:15 +01:00
parent 49782765b4
commit e606a6f8ce
31 changed files with 1086 additions and 612 deletions

View File

@@ -79,7 +79,7 @@ class CouponFactory
/** @var CouponInterface $couponInterface */
$couponInterface = $this->buildCouponFromModel($couponModel);
if ($couponInterface && $couponInterface->getConditions()->isEmpty()) {
if ($couponInterface && $couponInterface->getConditions()->count() == 0) {
throw new InvalidConditionException(
get_class($couponInterface)
);
@@ -129,7 +129,7 @@ class CouponFactory
$couponManager->setConditions($conditions);
return $couponManager;
return clone $couponManager;
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Coupon\Type;
use Thelia\Coupon\FacadeInterface;
use Thelia\Coupon\Type\CouponAbstract;
/**