WIP : Refactor contraint/rule becomes conditions (more generic)

This commit is contained in:
gmorel
2013-09-25 14:51:42 +02:00
parent cb389f126c
commit d6172f23cf
75 changed files with 582 additions and 2787 deletions

View File

@@ -30,24 +30,23 @@ use Thelia\Log\Tlog;
* Date: 8/19/13
* Time: 3:24 PM
*
* Thrown when a Rule receive an invalid Parameter
* Thrown when a Condition receive an invalid Operator
*
* @package Coupon
* @package Condition
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class InvalidRuleValueException extends \RuntimeException
class InvalidConditionOperatorException extends \RuntimeException
{
/**
* InvalidRuleValueException thrown when a Rule is given a bad Parameter
* InvalidConditionOperatorException thrown when a Condition is given a bad Operator
*
* @param string $className Class name
* @param string $parameter array key parameter
*/
public function __construct($className, $parameter)
{
$message = 'Invalid Parameter for Rule ' . $className . ' on parameter ' . $parameter;
$message = 'Invalid Operator for Condition ' . $className . ' on parameter ' . $parameter;
Tlog::getInstance()->addError($message);
parent::__construct($message);

View File

@@ -30,16 +30,16 @@ use Thelia\Log\Tlog;
* Date: 8/19/13
* Time: 3:24 PM
*
* Thrown when a Rule receive an invalid Operator
* Thrown when a Condition receives an invalid Parameter
*
* @package Coupon
* @package Condition
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class InvalidRuleOperatorException extends \RuntimeException
class InvalidConditionValueException extends \RuntimeException
{
/**
* InvalidRuleOperatorException thrown when a Rule is given a bad Operator
* InvalidConditionValueException thrown when a Condition is given a bad Parameter
*
* @param string $className Class name
* @param string $parameter array key parameter
@@ -47,7 +47,7 @@ class InvalidRuleOperatorException extends \RuntimeException
public function __construct($className, $parameter)
{
$message = 'Invalid Operator for Rule ' . $className . ' on parameter ' . $parameter;
$message = 'Invalid Parameter for Condition ' . $className . ' on parameter ' . $parameter;
Tlog::getInstance()->addError($message);
parent::__construct($message);

View File

@@ -39,7 +39,7 @@ use Thelia\Log\Tlog;
class InvalidRuleException extends \RuntimeException
{
/**
* InvalidRuleOperatorException thrown when a Rule is badly implemented
* InvalidConditionOperatorException thrown when a Rule is badly implemented
*
* @param string $className Class name
*/