-
Notifications
You must be signed in to change notification settings - Fork 0
Description
What if we create an AS3 "Enumeration" class type in Aerial. Doctrine already supports it and defines the enum values in the PHP models. It would be nice to be able to do something like:
var invoice:InvoiceVO;
var status:Enumeration = invoice.status;
trace(status.values) // ["pending", "shipped", "complete"];
trace(status) // "complete"
We might even be able to expand on this basic implementation to support enumerated values stored via foreign key/reference tables and aggregate multiple reference table columns:
trace(Country.state.values) // [{id:1, abbr:"AL", name:"Alabama"}, {id:2, abbr:"AK", name:"Alaska"},];
trace(Country.state) // 0 <--- (AL); with complex objects, we could return the index of the value.
trace(Country.state.values[1]) // {id:2, abbr:"AK", name:"Alaska"}