Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aerial AS3 Enumeration type #31

Open
cesaric opened this issue Aug 25, 2011 · 0 comments
Open

Aerial AS3 Enumeration type #31

cesaric opened this issue Aug 25, 2011 · 0 comments
Labels

Comments

@cesaric
Copy link
Member

cesaric commented Aug 25, 2011

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"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant