Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add documentation for constants

  • Loading branch information...
commit 9c69de5b41d67ed99c04694402fb70459ae514e2 1 parent 556ee99
Fabio B. Silva FabioBatSilva authored
Showing with 37 additions and 3 deletions.
  1. +37 −3 en/reference/annotations.rst
40 en/reference/annotations.rst
View
@@ -432,6 +432,42 @@ If the data type not match you got an ``AnnotationException``
// some code
}
+
+Constants
+-----------
+
+The use of constants and class constants are available on the annotations parser.
+
+The following usage are allowed :
+
+.. code-block :: php
+
+ <?php
+ namespace MyCompany\Entity;
+
+ use MyCompany\Annotations\Foo;
+ use MyCompany\Annotations\Bar;
+ use MyCompany\Entity\SomeClass;
+
+ /**
+ * @Foo(PHP_EOL)
+ * @Bar(Bar::FOO)
+ * @Foo({SomeClass::FOO, SomeClass::BAR})
+ * @Bar({SomeClass::FOO_KEY = SomeClass::BAR_VALUE})
+ */
+ class User
+ {
+ }
+
+
+Be careful with constants and the cache !
+
+.. note::
+
+ The cached reader will not re-evaluate each time an annotation is loaded from cache.
+ When a constant is changed the cache must be cleaned.
+
+
Usage
-----
@@ -487,6 +523,4 @@ IDE Support
Some IDEs already provide support for annotations:
-- Eclipse via the `Symfony2 Plugin <http://symfony.dubture.com/>`_
-
-
+- Eclipse via the `Symfony2 Plugin <http://symfony.dubture.com/>`_
Please sign in to comment.
Something went wrong with that request. Please try again.