WIP : Refactor contraint/rule becomes conditions (more generic)
This commit is contained in:
@@ -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);
|
||||
@@ -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);
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user