Message-ID: <1873480601.3284.1485852603122.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3283_930707813.1485852603122" ------=_Part_3283_930707813.1485852603122 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Structuring the bundle

Structuring the bundle

At this point, we have an =E2=80=9Canonymous=E2=80=9D Sy= mfony 2 bundle.  

Let=E2=80=99s start by creating the structure for our Field Type. To mak= e it easier to move around the code, we will to some extent mimic the struc= ture that is used in the kernel. Native Field Types are located inside ezpublish-kernel (in vendor/ezsystems), in the = eZ/Publish/Core/FieldType folder. Each Field Type has its own subfo= lder: TextLine, Email, Url, etc. = We will use a structure quite close to this.

From the tutorial repository, list the contents of the eZ/Publish= /FieldType folder:

 eZ
=E2=94=94=E2=94=80=E2=94=80 Publish
    =E2=94=94= =E2=94=80=E2=94=80 FieldType
       =E2=94=94=E2=94= =80=E2=94=80 Tweet
           =E2=94=9C= =E2=94=80=E2=94=80 Type.php
           = =E2=94=94=E2=94=80=E2=94=80 Value.php

We have the two base classes required by a Field Type: Type and Value.

The Type class

The Type contains the logic of the Field Type: validating data, transfor= ming from various formats, describing the validators, etc.
A Type class= must implement eZ\Publish\SPI\FieldType\FieldType . It may a= lso extend the eZ\Publish\Core\FieldType\FieldType abstract c= lass.

The Value class

The Value is used to represent an instance of our type within a Content = item. Each Field will present its data using an instance of the Type=E2=80= =99s Value class.
A value class must implement the eZ\Publish\SP= I\FieldType\Value interface. It may also extend the eZ\Publi= sh\Core\FieldType\Value abstract class.

------=_Part_3283_930707813.1485852603122--