Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Validate_Db_NoRecordExists Class Reference
Inheritance diagram for Zend_Validate_Db_NoRecordExists:
Zend_Validate_Db_Abstract Zend_Validate_Abstract Zend_Validate_Interface

Public Member Functions

 isValid ($value)
 
- Public Member Functions inherited from Zend_Validate_Db_Abstract
 __construct ($options)
 
 getAdapter ()
 
 setAdapter ($adapter)
 
 getExclude ()
 
 setExclude ($exclude)
 
 getField ()
 
 setField ($field)
 
 getTable ()
 
 setTable ($table)
 
 getSchema ()
 
 setSchema ($schema)
 
 setSelect ($select)
 
 getSelect ()
 
- 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 ()
 

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)
 
- Data Fields inherited from Zend_Validate_Db_Abstract
const ERROR_NO_RECORD_FOUND = 'noRecordFound'
 
const ERROR_RECORD_FOUND = 'recordFound'
 
- Protected Member Functions inherited from Zend_Validate_Db_Abstract
 _query ($value)
 
- Protected Member Functions inherited from Zend_Validate_Abstract
 _createMessage ($messageKey, $value)
 
 _implodeRecursive (array $pieces)
 
 _error ($messageKey, $value=null)
 
 _setValue ($value)
 
- Protected Attributes inherited from Zend_Validate_Db_Abstract
 $_messageTemplates
 
 $_schema = null
 
 $_table = ''
 
 $_field = ''
 
 $_exclude = null
 
 $_adapter = null
 
 $_select
 
- Protected Attributes inherited from Zend_Validate_Abstract
 $_value
 
 $_messageVariables = array()
 
 $_messageTemplates = array()
 
 $_messages = array()
 
 $_obscureValue = false
 
 $_errors = array()
 
 $_translator
 
 $_translatorDisabled = false
 
- Static Protected Attributes inherited from Zend_Validate_Abstract
static $_defaultTranslator
 
static $_messageLength = -1
 

Detailed Description

Definition at line 36 of file NoRecordExists.php.

Member Function Documentation

◆ isValid()

isValid (   $value)

Returns true if and only if $value meets the validation requirements

If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.

Parameters
mixed$value
Returns
boolean
Exceptions
Zend_Validate_ExceptionIf validation of $value is impossible

Implements Zend_Validate_Interface.

Definition at line 38 of file NoRecordExists.php.

39  {
40  $valid = true;
41  $this->_setValue($value);
42 
43  $result = $this->_query($value);
44  if ($result) {
45  $valid = false;
46  $this->_error(self::ERROR_RECORD_FOUND);
47  }
48 
49  return $valid;
50  }
_error($messageKey, $value=null)
Definition: Abstract.php:284
$value
Definition: gender.phtml:16

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