Validate/EmailAddress.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id$  

\Zend_Validate_EmailAddress

Package: Zend_Validate
Parent(s)
\Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  INVALID = 'emailAddressInvalid'
>VConstant  INVALID_FORMAT = 'emailAddressInvalidFormat'
>VConstant  INVALID_HOSTNAME = 'emailAddressInvalidHostname'
>VConstant  INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'
>VConstant  INVALID_SEGMENT = 'emailAddressInvalidSegment'
>VConstant  DOT_ATOM = 'emailAddressDotAtom'
>VConstant  QUOTED_STRING = 'emailAddressQuotedString'
>VConstant  INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'
>VConstant  LENGTH_EXCEEDED = 'emailAddressLengthExceeded'

Properties

Methods

methodpublic__construct(array | \Zend_Config $options = array()) : void

Instantiates hostname validator for local use

The following option keys are supported: 'hostname' => A hostname validator, see Zend_Validate_Hostname 'allow' => Options for the hostname validator, see Zend_Validate_Hostname::ALLOW_* 'mx' => If MX check should be enabled, boolean 'deep' => If a deep MX check should be done, boolean
Parameters
NameTypeDescription
$optionsarray | \Zend_Config

OPTIONAL

methodpublicgetDeepMxCheck() : boolean

Returns the set deepMxCheck option

Returns
TypeDescription
boolean
methodpublicgetDomainCheck() : \unknown

Returns the set domainCheck option

Returns
TypeDescription
\unknown
methodpublicgetHostnameValidator() : \Zend_Validate_Hostname

Returns the set hostname validator

Returns
TypeDescription
\Zend_Validate_Hostname
methodpublicgetOptions() : array

Returns all set Options

Returns
TypeDescription
array
methodpublicgetValidateMx() : boolean

Returns the set validateMx option

Returns
TypeDescription
boolean
methodpublicisValid(string $value) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if $value is a valid email address according to RFC2822
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
boolean
Details
Link
RFC2822  
Link
US-ASCII characters  
methodpublicsetDeepMxCheck(boolean $deep) : \Zend_Validate_EmailAddress

Set whether we check MX record should be a deep validation

Parameters
NameTypeDescription
$deepboolean

Set deep to true to perform a deep validation process for MX records

Returns
TypeDescription
\Zend_Validate_EmailAddressFluid Interface
methodpublicsetDomainCheck(boolean $domain = true) : \Zend_Validate_EmailAddress

Sets if the domain should also be checked or only the local part of the email address

Parameters
NameTypeDescription
$domainboolean
Returns
TypeDescription
\Zend_Validate_EmailAddressFluid Interface
methodpublicsetHostnameValidator(\Zend_Validate_Hostname $hostnameValidator = null, int $allow = \Zend_Validate_Hostname::ALLOW_DNS) : void

Parameters
NameTypeDescription
$hostnameValidator\Zend_Validate_Hostname

OPTIONAL

$allowint

OPTIONAL

methodpublicsetMessage(string $messageString, string $messageKey = null) : \Zend_Validate_Abstract

Sets the validation failure message template for a particular key Adds the ability to set messages to the attached hostname validator

Parameters
NameTypeDescription
$messageStringstring
$messageKeystring

OPTIONAL

Returns
TypeDescription
\Zend_Validate_AbstractProvides a fluent interface
Throws
ExceptionDescription
\Zend_Validate_Exception
methodpublicsetOptions(array $options = array()) : \Zend_Validate_EmailAddress

Set options for the email validator

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Validate_EmailAddressfluid interface
methodpublicsetValidateMx(boolean $mx) : \Zend_Validate_EmailAddress

Set whether we check for a valid MX record via DNS

This only applies when DNS hostnames are validated
Parameters
NameTypeDescription
$mxboolean

Set allowed to true to validate for MX records, and false to not validate them

Returns
TypeDescription
\Zend_Validate_EmailAddressFluid Interface
methodpublicvalidateMxSupported() : boolean

Whether MX checking via getmxrr is supported or not

This currently only works on UNIX systems
Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.2.0 .