[pLog-svn] r7124 - plog/branches/lifetype-1.2/class/data/validator
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Thu Sep 1 08:59:45 EDT 2011
Author: jondaley
Date: 2011-09-01 08:59:45 -0400 (Thu, 01 Sep 2011)
New Revision: 7124
Added:
plog/branches/lifetype-1.2/class/data/validator/integerrangevalidator.class.php
Log:
handy validator, and we already have the rule built
Copied: plog/branches/lifetype-1.2/class/data/validator/integerrangevalidator.class.php (from rev 7123, plog/branches/lifetype-1.2/class/data/validator/integervalidator.class.php)
===================================================================
--- plog/branches/lifetype-1.2/class/data/validator/integerrangevalidator.class.php (rev 0)
+++ plog/branches/lifetype-1.2/class/data/validator/integerrangevalidator.class.php 2011-09-01 12:59:45 UTC (rev 7124)
@@ -0,0 +1,28 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/data/validator/validator.class.php" );
+
+ /**
+ * \ingroup Validator
+ *
+ * Checks that the value is an integer and between a certain range
+ *
+ * @see IntRangeRule
+ */
+ class IntegerRangeValidator extends Validator
+ {
+ /**
+ * Constructor.
+ *
+ * @param signed Whether to allow signed integers or not. For compatibility reasons,
+ * signed integers are not allowed by default.
+ */
+ function IntegerRangeValidator( $minValue, $maxValue )
+ {
+ $this->Validator();
+
+ lt_include( PLOG_CLASS_PATH."class/data/validator/rules/intrangerule.class.php" );
+ $this->addRule( new IntRangeRule($minValue, $maxValue));
+ }
+ }
+?>
\ No newline at end of file
More information about the pLog-svn
mailing list