[pLog-svn] r3832 - plog/trunk/class/data/validator/rules

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Aug 2 09:32:19 GMT 2006


Author: mark
Date: 2006-08-02 09:32:18 +0000 (Wed, 02 Aug 2006)
New Revision: 3832

Modified:
   plog/trunk/class/data/validator/rules/intrangerule.class.php
   plog/trunk/class/data/validator/rules/stringrangerule.class.php
Log:
Change the constant name to avoid conflict if we use both rules together.

Modified: plog/trunk/class/data/validator/rules/intrangerule.class.php
===================================================================
--- plog/trunk/class/data/validator/rules/intrangerule.class.php	2006-08-02 06:20:10 UTC (rev 3831)
+++ plog/trunk/class/data/validator/rules/intrangerule.class.php	2006-08-02 09:32:18 UTC (rev 3832)
@@ -2,8 +2,8 @@
 
     include_once( PLOG_CLASS_PATH."class/data/validator/rules/rule.class.php");
 
-    define( "ERROR_RULE_TOO_SMALL", "error_rule_too_small");
-    define( "ERROR_RULE_TOO_LARGE", "error_rule_too_large");
+    define( "ERROR_RULE_INTEGER_TOO_SMALL", "error_rule_integer_too_small");
+    define( "ERROR_RULE_INTEGER_TOO_LARGE", "error_rule_integer_too_large");
 
     /**
      * \ingroup Validator_Rules
@@ -11,7 +11,7 @@
      * Given two values that will be used as lower and upper boundaries of the range, 
      * it will validate whether the given value falls within the range.
      *
-     * It will set the errors ERROR_RULE_TOO_SMALL or ERROR_RULE_TOO_LARGE in case the
+     * It will set the errors ERROR_RULE_INTEGER_TOO_SMALL or ERROR_RULE_INTEGER_TOO_LARGE in case the
      * validation is not successful.
      */
     class IntRangeRule extends Rule
@@ -82,12 +82,12 @@
 
             if ($intValue < $this->_minValue)
             {
-                $this->_setError(ERROR_RULE_TOO_SMALL);
+                $this->_setError(ERROR_RULE_INTEGER_TOO_SMALL);
                 return false;
             }
             else if ($this->_maxValue != 0 && $intValue > $this->_maxValue)
             {
-                $this->_setError(ERROR_RULE_TOO_LARGE);
+                $this->_setError(ERROR_RULE_INTEGER_TOO_LARGE);
                 return false;
             }
             else

Modified: plog/trunk/class/data/validator/rules/stringrangerule.class.php
===================================================================
--- plog/trunk/class/data/validator/rules/stringrangerule.class.php	2006-08-02 06:20:10 UTC (rev 3831)
+++ plog/trunk/class/data/validator/rules/stringrangerule.class.php	2006-08-02 09:32:18 UTC (rev 3832)
@@ -2,8 +2,8 @@
 
     include_once( PLOG_CLASS_PATH."class/data/validator/rules/rule.class.php");
 
-    define( "ERROR_RULE_TOO_SMALL", "error_rule_too_small");
-    define( "ERROR_RULE_TOO_LARGE", "error_rule_too_large");
+    define( "ERROR_RULE_STRING_TOO_SMALL", "error_rule_string_too_small");
+    define( "ERROR_RULE_STRING_TOO_LARGE", "error_rule_string_too_large");
 
     /**
      * \ingroup Validator_Rules
@@ -11,7 +11,7 @@
      * Given two values that will be used as lower and upper boundaries of the string length, 
      * validates if the length of the given string is between the limits.
      *
-     * It will set the errors ERROR_RULE_TOO_SMALL or ERROR_RULE_TOO_LARGE in case the
+     * It will set the errors ERROR_RULE_STRING_TOO_SMALL or ERROR_RULE_STRING_TOO_LARGE in case the
      * validation is not successful.
      */
     class StringRangeRule extends Rule
@@ -81,12 +81,12 @@
 
             if ($len < $this->_minValue)
             {
-                $this->_setError(ERROR_RULE_TOO_SMALL);
+                $this->_setError(ERROR_RULE_STRING_TOO_SMALL);
                 return false;
             }
             else if ($this->_maxValue != 0 && $len > $this->_maxValue)
             {
-                $this->_setError(ERROR_RULE_TOO_LARGE);
+                $this->_setError(ERROR_RULE_STRING_TOO_LARGE);
                 return false;
             }
             else



More information about the pLog-svn mailing list