2. What is a Field Type
• Base building block of all content in eZ Publish
• Collection of methods to store, read and validate content
• Object oriented architecture of content model
• Content type – blueprint of a single piece of content
• Collection of class attributes, which are of some (data)type
• Content – a single piece of content
• Instance of a class
• Collection of Fields, values of FieldDefinitions
4. Updated Glossary
eZ Publish 4 eZ Publish 5
Content object Content
Content class Content Type
Content object attribute Field
Content class attribute Field Definition
Object attribute content Field Value
Datatype Field Type
8. FieldType API abstract classes
eZPublishCoreFieldTypeFieldType
• Abstract that implements …SPIFieldTypeFieldType
• Default behavior of some methods + validator handling
Needed for Legacy Storage Engine:
eZPublishCoreFieldTypeGatewayBasedStorage
• Abstract that implements …SPIFieldTypeFieldStorage
eZPublishCoreFieldTypeStorageGateway
• Abstract for gateways to external storage
• Used by GatewayBasedStorage
eZPublishCorePersistenceLegacyContentFieldValueCon
verter
9. FieldType API abstract classes #2
•eZPublishCoreFieldTypeValue
• Abstract for field value
•eZPublishCoreFieldTypeValidationError
• Implementation of
…SPIFieldTypeValidationError
•eZPublishCoreFieldTypeValidator
• Abstract for all validators to extend
•eZPublishCoreIOIOService
• Binary files IO handling
10. FieldType standardized unit/integration tests
•API integration tests
• Using real world implementation of repository
• Tests if our field type plays well with others
• eZPublishAPIRepositoryTestsFieldTypeTextLineIntegrationTest.php
•SPI integration tests
• Hooks directly into persistence implementation
• Tests if our field type stores and loads data correctly
• eZPublishSPITestsFieldTypeTextLineIntegrationTest.php
•Unit testing of the field type
• Tests the field type methods (units), one by one
• eZPublishCoreFieldTypeTestsTextLineTest.php
•TDD is your friend. Really!
11. What about BC
•Right now: Think dual kernel
• Datatype [legacy] for the backoffice
• FieldType [5.x] for the front
•Yes, you currently have to write both
12. The end
?
Twitter: @bdunogier & @andrerom
Google+: http://gplus.to/BertrandDunogier
SlideShare: http://slideshare.net/BertrandDunogier