Class Zend_Validate_EmailAddress

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/EmailAddress.php (line 42)

Zend_Validate_Abstract
   |
   --Zend_Validate_EmailAddress
Class Constant Summary
 DOT_ATOM = 'emailAddressDotAtom'
 INVALID = 'emailAddressInvalid'
 INVALID_HOSTNAME = 'emailAddressInvalidHostname'
 INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'
 INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'
 QUOTED_STRING = 'emailAddressQuotedString'
Variable Summary
Method Summary
 void __construct ([integer $allow = Zend_Validate_Hostname::ALLOW_DNS], [bool $validateMx = false], [Zend_Validate_Hostname $hostnameValidator = null])
 boolean isValid (string $value)
 void setHostnameValidator ([Zend_Validate_Hostname $hostnameValidator = null], [int $allow = Zend_Validate_Hostname::ALLOW_DNS])
 void setValidateMx (boolean $allowed)
 boolean validateMxSupported ()
Variables
Zend_Validate_Hostname $hostnameValidator (line 77)

Local object for validating the hostname part of an email address

  • access: public
string $_hostname (line 89)
  • access: protected
string $_localPart (line 94)
  • access: protected
array $_messageTemplates = array(
self::INVALID => "'%value%' is not a valid email address in the basic format local-part@hostname",
self::INVALID_HOSTNAME => "'%hostname%' is not a valid hostname for email address '%value%'",
self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'",
self::DOT_ATOM => "'%localpart%' not matched against dot-atom format",
self::QUOTED_STRING => "'%localpart%' not matched against quoted-string format",
self::INVALID_LOCAL_PART => "'%localpart%' is not a valid local part for email address '%value%'"
)
(line 55)
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
array $_messageVariables = array(
'hostname' => '_hostname',
'localPart' => '_localPart'
)
(line 67)
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageVariables
boolean $_validateMx = false (line 84)

Whether we check for a valid MX record via DNS

  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 108)

Instantiates hostname validator for local use

You can pass a bitfield to determine what types of hostnames are allowed. These bitfields are defined by the ALLOW_* constants in Zend_Validate_Hostname The default is to allow DNS hostnames only

  • access: public
void __construct ([integer $allow = Zend_Validate_Hostname::ALLOW_DNS], [bool $validateMx = false], [Zend_Validate_Hostname $hostnameValidator = null])
isValid (line 162)

Defined by Zend_Validate_Interface

Returns true if and only if $value is a valid email address according to RFC2822

boolean isValid (string $value)
  • string $value
setHostnameValidator (line 119)
  • access: public
void setHostnameValidator ([Zend_Validate_Hostname $hostnameValidator = null], [int $allow = Zend_Validate_Hostname::ALLOW_DNS])
setValidateMx (line 146)

Set whether we check for a valid MX record via DNS

This only applies when DNS hostnames are validated

  • access: public
void setValidateMx (boolean $allowed)
  • boolean $allowed: Set allowed to true to validate for MX records, and false to not validate them
validateMxSupported (line 134)

Whether MX checking via dns_get_mx is supported or not

This currently only works on UNIX systems

  • access: public
boolean validateMxSupported ()

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
DOT_ATOM = 'emailAddressDotAtom' (line 48)
INVALID = 'emailAddressInvalid' (line 45)
INVALID_HOSTNAME = 'emailAddressInvalidHostname' (line 46)
INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart' (line 50)
INVALID_MX_RECORD = 'emailAddressInvalidMxRecord' (line 47)
QUOTED_STRING = 'emailAddressQuotedString' (line 49)

Documentation generated on Sun, 27 May 2007 23:22:54 -0700 by phpDocumentor 1.3.2