<?php 
class VLDMenorQue extends Zend_Validate_Abstract {
	const NOT_MATCH = 'notMatch';
	private $CompareFieldName;
	protected $_messageTemplates = array(
			self::NOT_MATCH => 'El valor debe ser menor'  );
	public function __construct( $FieldName, $ErrorMsg ) {
		$this->CompareFieldName = $FieldName;    
		$this->_messageTemplates[self::NOT_MATCH] = $ErrorMsg;
	}    
	
	public function isValid($value, $context = null) {
		$value = (string) $value;   
		$this->_setValue($value);    
		if (is_array($context)) {
			if (isset($context[$this->CompareFieldName]) && ($value <= abs($context[$this->CompareFieldName]))){
				return true;
			}
		} elseif (is_string($context) && ($value == $context)) {
			return true;
		}    $this->_error(self::NOT_MATCH);    return false;
	}
}