Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

RelationList

This field type represents one or multiple relations to content.


NameInternal nameExpected input
RelationListezobjectrelationlistmixed


Description

This FieldType makes possible to store and retrieve values of relation to content.


Input expectations

Type
Description
Example
int|stringId of the related Content42
arrayAn array of related Content idsarray( 24, 42 )
eZ\Publish\API\Repository\Values\Content\ContentInfo

ContentInfo instance of the related Content

 
eZ\Publish\Core\FieldType\RelationList\ValueRelationList FieldType Value ObjectSee Value Object documentation section below.

RelationList Value Object API

eZ\Publish\Core\FieldType\RelationList\Value offers following properties.

PropertyTypeDescriptionExample

destinationContentIds

arrayAn array of related Content idsarray( 24, 42 )

Validation

This FieldType validates if the selectionMethod specified is 0 (self::SELECTION_BROWSE) or 1 (self::SELECTION_DROPDOWN). A validation error is thrown if the value does not match.

Also validates if the selectionDefaultLocation specified is null, string or integer. If the type validation fails a validation error is thrown.

And validates if the value specified in selectionContentTypes is an array. If not, a validation error in given.

 

Settings

The field definition of this FieldType can be configured with following options:

NameTypeDefault valueDescription

selectionMethod

mixed
SELECTION_BROWSE
Method of selection in the administration interface

selectionDefaultLocation

string|integernullId of the default Location for the selection when using administration interface

selectionContentTypes

arrayarray()An array of ContentType ids that are allowed for related Content

Following selection methods are available:

NameDescription
SELECTION_BROWSESelection will use browse mode
SELECTION_DROPDOWNSelection control will use dropdown control containing the Content list in the default Location for selection
RelationList FieldType example settings


Value object

Properties

The Value class of this field type contains the following properties:

PropertyTypeDescription
$destinationContentIdsmixed[]This property will be used to store the values provided, in the form of a mixed array, which will represent the related content list.
Value object content example

 

Constructor

The RelationList\Value constructor will initialize a new Value object with the value provided. It expects a mixed array as value.

Constructor example

 


  • No labels