Proposal
Registry should switch reimplement enumerations in a more consistent way.
Options
- Maintain the current custom implementation.
- Create a custom EnumerationBehavior, attached to Models that have enumerations.
- Implement Enumerations at an AppModel/AppTable, and have all relevant Models extend it.
- Use PHP SplEnum.
- Use CakeDC's Enum Plugin.
Evaluation Criteria
- The selected enumeration system must support mapping to database values (eg:
StatusEnum::Active
→A
). - The selected enumeration system must support mapping to language translations (eg:
StatusEnum::Active
→Active
). - The selected enumeration system must support the REST API.
- The selected enumeration system must support plugins.
- The selected enumeration system must support passing available options to views.
- The selected enumeration system should support extended types. (ie: Handle
StatusEnum
andIdentifier::type
the same way.)
Benefits
- Current enumeration mechanism is a bit hacky, and not really the "Cake" way.
Drawbacks
- All enumeration calls may need to be re-implemented.
Conclusion
TBD
- SplEnum is flagged as Experimental, and so not suitable for selection.
XXX