This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Step 2 - Define the Point 2D Field Type¶
The Type class¶
The Type contains logic of the Field Type: validating data, transforming from various formats, describing the validators, etc.
In this example Point 2D Field Type will extend the eZ\Publish\SPI\FieldType\Generic\Type
class.
For more information about the Type class of a Field Type, see Type class.
Field Type identifier¶
First, create src/FieldType/Point2D/Type.php
.
Add a getFieldTypeIdentifier()
method to it. The new method will return the string that uniquely identifies your Field Type, in this case point2d
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Add a new service definition¶
Next, add the ezplatform.field_type
tag to config/services.yaml
:
1 2 3 4 |
|