Enumerations
Info
This feature is available in Contao 5.3 and later.
Models can be used to resolve the values stored for a record into enumerations:
Set up the DCA
See the DCA reference for more information.
Resolve the Enumation
Only the value of an enumeration is stored in the database.
You can use Model::getEnum() to resolve the enumeration.
Type safe methods & fallback values
It is also possible to access the enumerations in a type-safe way using dedicated methods. In this process, you can also specify a suitable fallback if an enumeration cannot be resolved from the record’s value.