Message-ID: <595606461.3898.1485855822795.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3897_1212829.1485855822793" ------=_Part_3897_1212829.1485855822793 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html The EmailAddress FieldType

The EmailAddress FieldType

This field type represents an email address, in the form of a st= ring.

Name Internal name Expected input type
EmailAddress ezemail string

Table of contents:

=20 =20

Description


The EmailAddress FieldType stores an email address, which is provid= ed as a string.

Value object


Properties

The Value class of this field type contain= s the following properties:

Property Type Description
$email string This property will be used for the input string = provided as email address.
Value object content example
=20
use eZ\Publish\Core\FieldType\EmailAddress\Type;

// Instantiates an EmailAddress Value object with default value (empty stri=
ng)
$emailaddressValue =3D new Type\Value();

// Email definition
$emailaddressValue->email =3D "someuser@example.com";
=20

Constructor

The EmailAddress\Value constructor will initialize a new V= alue object with the value provided. It accepts a string as input.

Constructor example
=20
use eZ\Publish\Core\FieldType\EmailAddress\Type;
 
// Instantiates an EmailAddress Value object
$emailaddressValue =3D new Type\Value( "someuser@example.com" );
=20

String representat= ion

String representation of FieldType's Value object is the email address c= ontained in it.

Example:

someuser@example.com

Hash format

Hash value for this FieldType's Value is simply the email address as a s= tring.

Example:

someuser@example.com

Validation


This FieldType  uses the Email= AddressValidator validator as resource, which will tes= t the string supplied as input against a pattern, to make sure that a valid= email address has been provided.
If the validations fail a ValidationError  = is thrown, specifying the error message.

Settings


This FieldType does not support settings.

 

------=_Part_3897_1212829.1485855822793--