Public Member Functions | |
__construct ($allow=Zend_Validate_Hostname::ALLOW_DNS, $validateMx=false, Zend_Validate_Hostname $hostnameValidator=null) | |
getHostnameValidator () | |
setHostnameValidator (Zend_Validate_Hostname $hostnameValidator=null, $allow=Zend_Validate_Hostname::ALLOW_DNS) | |
validateMxSupported () | |
setValidateMx ($allowed) | |
isValid ($value) | |
Data Fields | |
const | INVALID = 'emailAddressInvalid' |
const | INVALID_FORMAT = 'emailAddressInvalidFormat' |
const | INVALID_HOSTNAME = 'emailAddressInvalidHostname' |
const | INVALID_MX_RECORD = 'emailAddressInvalidMxRecord' |
const | DOT_ATOM = 'emailAddressDotAtom' |
const | QUOTED_STRING = 'emailAddressQuotedString' |
const | INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart' |
const | LENGTH_EXCEEDED = 'emailAddressLengthExceeded' |
$hostnameValidator | |
Protected Attributes | |
$_messageTemplates | |
$_messageVariables | |
$_validateMx = false | |
$_hostname | |
$_localPart |
Definition at line 38 of file EmailAddress.php.
__construct | ( | $ | allow = Zend_Validate_Hostname::ALLOW_DNS , |
$ | validateMx = false , |
||
Zend_Validate_Hostname $ | hostnameValidator = null |
||
) |
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
integer | $allow | OPTIONAL |
bool | $validateMx | OPTIONAL |
Zend_Validate_Hostname | $hostnameValidator | OPTIONAL |
Definition at line 108 of file EmailAddress.php.
getHostnameValidator | ( | ) |
Returns the set hostname validator
Definition at line 119 of file EmailAddress.php.
isValid | ( | $ | value ) |
Defined by Zend_Validate_Interface
Returns true if and only if $value is a valid email address according to RFC2822
RFC2822 http://www.columbia.edu/kermit/ascii.html US-ASCII characters string $value boolean
MX checks are not supported by this system
Implements Zend_Validate_Interface.
Definition at line 172 of file EmailAddress.php.
setHostnameValidator | ( | Zend_Validate_Hostname $ | hostnameValidator = null , |
$ | allow = Zend_Validate_Hostname::ALLOW_DNS |
||
) |
Zend_Validate_Hostname | $hostnameValidator | OPTIONAL |
int | $allow | OPTIONAL |
Definition at line 129 of file EmailAddress.php.
setValidateMx | ( | $ | allowed ) |
Set whether we check for a valid MX record via DNS
This only applies when DNS hostnames are validated
boolean | $allowed | Set allowed to true to validate for MX records, and false to not validate them |
Definition at line 156 of file EmailAddress.php.
validateMxSupported | ( | ) |
Whether MX checking via dns_get_mx is supported or not
This currently only works on UNIX systems
Definition at line 144 of file EmailAddress.php.
$_messageTemplates [protected] |
array( self::INVALID => "Invalid type given, value should be a string", self::INVALID_FORMAT => "'%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%'", self::LENGTH_EXCEEDED => "'%value%' exceeds the allowed length" )
Reimplemented from Zend_Validate_Abstract.
Definition at line 52 of file EmailAddress.php.
$_messageVariables [protected] |
array( 'hostname' => '_hostname', 'localPart' => '_localPart' )
Reimplemented from Zend_Validate_Abstract.
Definition at line 66 of file EmailAddress.php.