- Coupon - add rule AJAX
This commit is contained in:
gmorel
2013-09-09 16:40:53 +02:00
parent 849520eff9
commit b778898d92
23 changed files with 689 additions and 132 deletions

View File

@@ -49,6 +49,12 @@ class CouponManager
/** @var array CouponInterface to process*/
protected $coupons = array();
/** @var array Available Coupons (Services) */
protected $availableCoupons = array();
/** @var array Available Rules (Services) */
protected $availableRules = array();
/**
* Constructor
*
@@ -208,4 +214,44 @@ class CouponManager
return $rule;
}
/**
* Add an available CouponManager (Services)
*
* @param CouponInterface $coupon CouponManager
*/
public function addAvailableCoupon(CouponInterface $coupon)
{
$this->availableCoupons[] = $coupon;
}
/**
* Get all available CouponManagers (Services)
*
* @return array
*/
public function getAvailableCoupons()
{
return $this->availableCoupons;
}
/**
* Add an available ConstraintManager (Services)
*
* @param CouponRuleInterface $rule CouponRuleInterface
*/
public function addAvailableRule(CouponRuleInterface $rule)
{
$this->availableRules[] = $rule;
}
/**
* Get all available ConstraintManagers (Services)
*
* @return array
*/
public function getAvailableRules()
{
return $this->availableRules;
}
}