Skip to content

Aerial AS3 Enumeration type #31

Description

@cesaric

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions