00001 <?php 00002 00027 require_once 'Zend/Validate/Abstract.php'; 00028 00029 00036 class Zend_Validate_GreaterThan extends Zend_Validate_Abstract 00037 { 00038 00039 const NOT_GREATER = 'notGreaterThan'; 00040 00044 protected $_messageTemplates = array( 00045 self::NOT_GREATER => "'%value%' is not greater than '%min%'" 00046 ); 00047 00051 protected $_messageVariables = array( 00052 'min' => '_min' 00053 ); 00054 00060 protected $_min; 00061 00068 public function __construct($min) 00069 { 00070 $this->setMin($min); 00071 } 00072 00078 public function getMin() 00079 { 00080 return $this->_min; 00081 } 00082 00089 public function setMin($min) 00090 { 00091 $this->_min = $min; 00092 return $this; 00093 } 00094 00103 public function isValid($value) 00104 { 00105 $this->_setValue($value); 00106 00107 if ($this->_min >= $value) { 00108 $this->_error(self::NOT_GREATER); 00109 return false; 00110 } 00111 return true; 00112 } 00113 00114 }