Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Zend_Validate_GreaterThan Class Reference
Inheritance diagram for Zend_Validate_GreaterThan:
Zend_Validate_Abstract Zend_Validate_Interface

Public Member Functions

 __construct ($min)
 
 getMin ()
 
 setMin ($min)
 
 isValid ($value)
 
- Public Member Functions inherited from Zend_Validate_Abstract
 getMessages ()
 
 getMessageVariables ()
 
 getMessageTemplates ()
 
 setMessage ($messageString, $messageKey=null)
 
 setMessages (array $messages)
 
 __get ($property)
 
 getErrors ()
 
 setObscureValue ($flag)
 
 getObscureValue ()
 
 setTranslator ($translator=null)
 
 getTranslator ()
 
 hasTranslator ()
 
 setDisableTranslator ($flag)
 
 translatorIsDisabled ()
 

Data Fields

const NOT_GREATER = 'notGreaterThan'
 

Protected Attributes

 $_messageTemplates
 
 $_messageVariables
 
 $_min
 
- Protected Attributes inherited from Zend_Validate_Abstract
 $_value
 
 $_messageVariables = array()
 
 $_messageTemplates = array()
 
 $_messages = array()
 
 $_obscureValue = false
 
 $_errors = array()
 
 $_translator
 
 $_translatorDisabled = false
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Validate_Abstract
static setDefaultTranslator ($translator=null)
 
static getDefaultTranslator ()
 
static hasDefaultTranslator ()
 
static getMessageLength ()
 
static setMessageLength ($length=-1)
 
- Protected Member Functions inherited from Zend_Validate_Abstract
 _createMessage ($messageKey, $value)
 
 _implodeRecursive (array $pieces)
 
 _error ($messageKey, $value=null)
 
 _setValue ($value)
 
- Static Protected Attributes inherited from Zend_Validate_Abstract
static $_defaultTranslator
 
static $_messageLength = -1
 

Detailed Description

Definition at line 33 of file GreaterThan.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $min)

Sets validator options

Parameters
mixed | Zend_Config$min
Exceptions
Zend_Validate_Exception

Definition at line 65 of file GreaterThan.php.

66  {
67  if ($min instanceof Zend_Config) {
68  $min = $min->toArray();
69  }
70 
71  if (is_array($min)) {
72  if (array_key_exists('min', $min)) {
73  $min = $min['min'];
74  } else {
75  #require_once 'Zend/Validate/Exception.php';
76  throw new Zend_Validate_Exception("Missing option 'min'");
77  }
78  }
79 
80  $this->setMin($min);
81  }

Member Function Documentation

◆ getMin()

getMin ( )

Returns the min option

Returns
mixed

Definition at line 88 of file GreaterThan.php.

89  {
90  return $this->_min;
91  }

◆ isValid()

isValid (   $value)

Defined by Zend_Validate_Interface

Returns true if and only if $value is greater than min option

Parameters
mixed$value
Returns
boolean

Implements Zend_Validate_Interface.

Definition at line 113 of file GreaterThan.php.

114  {
115  $this->_setValue($value);
116 
117  if ($this->_min >= $value) {
118  $this->_error(self::NOT_GREATER);
119  return false;
120  }
121  return true;
122  }
_error($messageKey, $value=null)
Definition: Abstract.php:284
$value
Definition: gender.phtml:16

◆ setMin()

setMin (   $min)

Sets the min option

Parameters
mixed$min
Returns
Zend_Validate_GreaterThan Provides a fluent interface

Definition at line 99 of file GreaterThan.php.

100  {
101  $this->_min = $min;
102  return $this;
103  }

Field Documentation

◆ $_messageTemplates

$_messageTemplates
protected
Initial value:
= array(
self::NOT_GREATER => "'%value%' is not greater than '%min%'",
)

Definition at line 41 of file GreaterThan.php.

◆ $_messageVariables

$_messageVariables
protected
Initial value:
= array(
'min' => '_min'
)

Definition at line 48 of file GreaterThan.php.

◆ $_min

$_min
protected

Definition at line 57 of file GreaterThan.php.

◆ NOT_GREATER

const NOT_GREATER = 'notGreaterThan'

Definition at line 36 of file GreaterThan.php.


The documentation for this class was generated from the following file: