Country Field Type¶
This Field Type represents one or multiple countries.
|Name||Internal name||Expected input|
PHP API Field Type¶
1 2 3 4 5 6 7 8
When you set an array directly on a Content Field you don't need to provide all this information, the Field Type will assume it is a hash and in this case will accept a simplified structure described below under Hash format.
This Field Type validates whether multiple countries are allowed by the Field definition, and whether the Alpha2 is valid according to the countries configured in eZ Platform.
The Field definition of this Field Type can be configured with one option:
||This setting allows (if true) or prohibits (if false) the selection of multiple countries.|
1 2 3 4
The format used for serialization is simpler than the full format. It is also available when setting value on the content Field, by setting the value to 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 capable of accepting either Name, Alpha2 or Alpha3 value as shown below in the Value object section.
The Value class of this Field Type contains the following properties:
||This property is used for the country selection provided as input, as its attributes.|
1 2 3 4 5 6 7 8 9
Country\Value constructor will initialize a new Value object with the value provided. It expects an array as input.
1 2 3 4 5 6 7 8 9 10 11 12 13