- Coupon : add rule input ajax controller
This commit is contained in:
gmorel
2013-09-09 10:03:00 +02:00
parent 447488f063
commit 2d6787e588
5 changed files with 59 additions and 1 deletions

View File

@@ -140,4 +140,23 @@ class ConstraintFactory
return $rule;
}
/**
* Get Coupon Rule inputs from serviceId
*
* @param string $ruleServiceId Rule class name
*
* @return array Ready to be drawn rule inputs
*/
public function getInputs($ruleServiceId)
{
if (!$this->container->has($ruleServiceId)) {
return false;
}
/** @var CouponRuleInterface $rule */
$rule = $this->container->get($ruleServiceId);
return $rule->getValidators();
}
}