Datatypes
A datatype is the smallest possible entity of storage. It determines how a specific type of information should be validated, stored, retrieved, formatted and so on. eZ publish comes with a collection of fundamental datatypes that can be used to build powerful and complex content structures. In addition, it is possible to extend the system by creating custom datatypes for special needs. Custom datatypes have to be programmed in PHP. However, the built in datatypes are usually sufficient enough for typical scenarios. The following table gives an overview of the most basic datatypes that come with eZ publish.
Datatype | Description |
---|---|
Stores a single line of unformatted text |
|
Stores multiple lines of unformatted text |
|
Validates and stores multiple lines of formatted text |
|
Validates and stores a numerical integer value |
|
Validates and stores a numerical floating point value |
Please refer to the "Datatypes" section of the reference chapter for a comprehensive list of all the built-in datatypes. Additional datatypes can be downloaded from http://ez.no/community/contribs/datatypes; they are created by the members of the eZ publish community.
Input validation
As the list above indicates, some datatypes take care of more than just storing data. For example, the "XML block" datatype apparently supports validation. This means that the inputted XML will be validated before it is actually stored in the database. In other words, the system will only accept and store the data if it is a valid XML structure. Input validation is supported by most (but not all) of the built in datatypes. The validation feature of a datatype can not be turned on or off. In other words, if a datatype happens to support validation, it will always try to validate the incoming data and thus the system will never allow the storage of incorrectly formatted input.
Balazs Halasy (20/01/2005 3:04 pm)
Svitlana Shatokhina (31/08/2006 8:30 am)
Comments
Is it possible to change datatypes after class creation?
Friday 19 August 2005 10:25:34 pm
Deane
I'm guessing that you can't because some of the datatypes are complex and the data stored in them just wouldn't transfer to another type. Additionally, I know that the database has different columns for integers and strings and such.
Can I an confirmation that this is not possible?
Re: Is it possible to change datatypes after class creation?
Friday 21 October 2005 12:19:22 pm
Balazs Halasy
Allman
option
Tuesday 07 March 2006 10:35:25 am
Jannick