Merge branch 'master' of git://github.com/thelia/thelia into french_translation

* 'master' of git://github.com/thelia/thelia: (23 commits)
  Coupon : Add unit test for coupon removing X Amount & X Percent
  Coupon : Add unit test for coupon removing X Amount & X Percent
  Coupon : Add unit test for coupon removing X Amount & X Percent
  Coupon : Add unit test for coupon removing X Amount & X Percent
  Coupon : Add unit test for coupon removing X Amount & X Percent
  Coupon : Fix namespace issues
  Coupon : Fix namespace issues
  Coupon : Adding unit tests
  Coupon : Adding unit tests
  Coupon : Adding unit tests
  Coupon : Adding unit tests
  Coupon : buildCouponFromModel becomes public
  Coupon : Add ability to know usage left after decremental
  Coupon : Bug fix when coupon max usage was not correctly decremented
  Coupon : spelling
  Coupon : rename
  Coupon : Fix the error if a given coupon leads to an unknown service id
  Coupon not found by the factory now just return false
  Fix generated unit test stub files
  Refactor removing Manager notion
  ...
This commit is contained in:
gmorel
2013-11-28 21:29:22 +01:00
42 changed files with 1594 additions and 1079 deletions

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Event\Coupon;
use Thelia\Core\Event\ActionEvent;
use Thelia\Coupon\ConditionCollection;
use Thelia\Condition\ConditionCollection;
use Thelia\Model\Coupon;
/**
@@ -39,7 +39,7 @@ use Thelia\Model\Coupon;
*/
class CouponCreateOrUpdateEvent extends ActionEvent
{
/** @var ConditionCollection Array of ConditionManagerInterface */
/** @var ConditionCollection Array of ConditionInterface */
protected $conditions = null;
/** @var string Coupon code (ex: XMAS) */
@@ -280,7 +280,7 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/**
* Get Conditions
*
* @return null|ConditionCollection Array of ConditionManagerInterface
* @return null|ConditionCollection Array of ConditionInterface
*/
public function getConditions()
{
@@ -290,7 +290,7 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/**
* Set Conditions
*
* @param ConditionCollection $conditions Array of ConditionManagerInterface
* @param ConditionCollection $conditions Array of ConditionInterface
*
* @return $this
*/

View File

@@ -26,7 +26,7 @@ namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\Util\PropelModelPager;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\ConditionManagerInterface;
use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
@@ -125,7 +125,7 @@ class Coupon extends BaseI18nLoop implements PropelSearchLoopInterface
$daysLeftBeforeExpiration = floor($datediff/(60*60*24));
$cleanedConditions = array();
/** @var ConditionManagerInterface $condition */
/** @var ConditionInterface $condition */
foreach ($conditions->getConditions() as $condition) {
$cleanedConditions[] = $condition->getToolTip();
}