General

  eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
 
Technical documentation:



⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This field type Field Type represents one or multiple countries.

...

Table of Contents
minLevel2

Description

This FieldType Field Type makes possible to store and retrieve data representing countries.

...

TypeExample
array
Code Block
languagephp
linenumberstrue
array(
    "JP" => array(
	    "Name" => "Japan",
        "Alpha2" => "JP",
        "Alpha3" => "JPN",
        "IDC" => 81
    )
);

Note: When you set a an array directly on Content field you don't need to provide all this information, the FieldType Field Type will assume it is a hash and in this case it will accept a simplified structure described below in the under To / From Hash format.

Validation

This FieldType Field Type validates if the multiple countries are allowed by the field definition, and if the Alpha2 is valid according to the countries configured in eZ PublishPlatform.

Settings

The field definition of this FieldType Field Type can be configured with one option:

...

Code Block
languagephp
titleCountry FieldType example settings
linenumberstrue
$settings = array(
	"isMultiple" => true
);

Anchor
ToFromHashFormat
ToFromHashFormat
To / From Hash format

The format used for serialization is simpler then than the full format, this is also available when setting value on the content field, by setting the value to a an array instead of the Value object. Example of that shown below:

...

The format used by the toHash method is the Alpha2 value, however the input is cable capable of accepting either Name, Alpha2 or Alpha3 value as shown below in the Value object section.

...