Skip to content
JonathanO edited this page Jun 2, 2012 · 1 revision

Enum

Used on a static property which must be initialised as an array. This allows use of the array as an "enum" in annotation parameters.

Parameters

  1. name (string) The Enum's name (defaults to the property name)

Examples

<?
/**
 * @Annotation
 */
class Foo {
  /**
   * @Enum("Id")
   */
  public static $enumId = array( "HELLO" => 1, "GOODBYE" => 2 );

This would allow use of "Foo.Id.HELLO" as a value in parameter for an annotation:

@Foo(blah=Foo.Id.HELLO)

Back to Annotations list

Clone this wiki locally