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

Relation Field Type

=20
=20
=20
=20

This Field Type represents a relation to a Content item.

Name Internal name Expected input
Relation ezobjectrelation mixed

Description

This Field Type makes it possible to store and retrieve the value of rel= ation to a Content item.

PHP API Field Type 

Input expectations

Type Example
string
"150"
integer  150

Value object

Properties

The Value class of this Field Type contains the following properties:

Property Type Description
$destinationContentId string|int|null This property will be used to stor= e the value provided, which will represent the related content.
Value object content example
=20
$relation->destinationContentId =3D $contentInfo->id;
= =20
Constructor

The Relation\Value constructor will&= nbsp;initialize a new Value object with the value provided. It expects a mi= xed value.

Constructor example
=20
// Instantiates a Relation Value object
$relationValue =3D new Relation\Value( $contentInfo->id );
=20

Validation

This Field Type validates whether the provided relation exists, but befo= re it does that it will check that the value is either string or int.

Settings

The field definition of this Field Type can be configured with two optio= ns:

Name Type Default value Description
selectionMethod<= /code> int self::SELECTION_BROWSE

This setting defines the selection method. It= expects an integer (0/1). 0 stands for self::SELECTION_BROWSE= , 1 stands for self::SELECTION_DROPDOWN.

 

NOTE: Dropdown not implemented in Platform UI yet, only browse is used c= urrently.

selection= Root string null This setting defines the selection= root.
Relation FieldType example settings
=20
use eZ\Publish\Core\FieldType\Relation\Type;

$settings =3D array(
=09"selectionMethod" =3D> 1,
=09"selectionRoot" =3D> null
);
=20

Note: These settings are meant for future use in user interface when all= owing users to select relations.

 

=20
=20
=20
=20

 

=20
=20
=20
------=_Part_4131_708881412.1485857825451--