Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

correct method name

  • Loading branch information...
commit 87ea8b8cfe3181dcd6294767eee5d7bfe552501c 1 parent d9e69bd
@gimler gimler authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 en/reference/annotations.rst
View
8 en/reference/annotations.rst
@@ -73,15 +73,15 @@ To anticipate the configuration section, making the above PHP class work with Do
use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerFile("/path/to/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
- AnnotationRegistry::registerAnnotationNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
- AnnotationRegistry::registerAnnotationNamespace("MyProject\Annotations", "/path/to/myproject/src");
+ AnnotationRegistry::registerAutoloadNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
+ AnnotationRegistry::registerAutoloadNamespace("MyProject\Annotations", "/path/to/myproject/src");
$reader = new AnnotationReader();
AnnotationReader::addGlobalIgnoredName('dummy');
The second block with the annotation registry calls registers all the three different annotation namespaces that are used.
Doctrine saves all its annotations in a single file, that is why ``AnnotationRegistry#registerFile`` is used in contrast to
-``AnnotationRegistry#registerAnnotationNamespace`` which creates a PSR-0 compatible loading mechanism for class to file names.
+``AnnotationRegistry#registerAutoloadNamespace`` which creates a PSR-0 compatible loading mechanism for class to file names.
In the third block, we create the actual AnnotationReader instance. Note that we also add "dummy" to the global list of annotations
for which we do not throw exceptions. Setting this is necessary in our example case, otherwise @dummy would trigger an exception to
@@ -523,4 +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.