@@ -12,6 +12,7 @@ steps of configuration.
12
12
13
13
use Doctrine\ORM\Configuration;
14
14
use Doctrine\ORM\EntityManager;
15
+ use Doctrine\ORM\Mapping\Driver\AttributeDriver;
15
16
use Doctrine\ORM\ORMSetup;
16
17
use Symfony\Component\Cache\Adapter\ArrayAdapter;
17
18
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
@@ -28,7 +29,7 @@ steps of configuration.
28
29
29
30
$config = new Configuration;
30
31
$config->setMetadataCache($metadataCache);
31
- $driverImpl = ORMSetup::createDefaultAnnotationDriver( '/path/to/lib/MyProject/Entities');
32
+ $driverImpl = new AttributeDriver([ '/path/to/lib/MyProject/Entities'] );
32
33
$config->setMetadataDriverImpl($driverImpl);
33
34
$config->setQueryCache($queryCache);
34
35
$config->setProxyDir('/path/to/myproject/lib/MyProject/Proxies');
@@ -124,18 +125,17 @@ used in the examples. For information on the usage of the
124
125
AnnotationDriver, XmlDriver or YamlDriver please refer to the dedicated
125
126
chapters ``Annotation Reference ``, ``XML Mapping `` and ``YAML Mapping ``.
126
127
127
- The annotation driver can be configured with a factory method on
128
- the ``Doctrine\ORM\Configuration ``:
128
+ The attribute driver can be injected in the ``Doctrine\ORM\Configuration ``:
129
129
130
130
.. code-block :: php
131
131
132
132
<?php
133
133
use Doctrine\ORM\ORMSetup;
134
134
135
- $driverImpl = ORMSetup::createDefaultAnnotationDriver( '/path/to/lib/MyProject/Entities');
135
+ $driverImpl = new AttributeDriver([ '/path/to/lib/MyProject/Entities'] );
136
136
$config->setMetadataDriverImpl($driverImpl);
137
137
138
- The path information to the entities is required for the annotation
138
+ The path information to the entities is required for the attribute
139
139
driver, because otherwise mass-operations on all entities through
140
140
the console could not work correctly. All of metadata drivers
141
141
accept either a single directory as a string or an array of
@@ -152,7 +152,7 @@ Metadata Cache (***RECOMMENDED***)
152
152
$config->getMetadataCache();
153
153
154
154
Gets or sets the cache adapter to use for caching metadata
155
- information, that is, all the information you supply via
155
+ information, that is, all the information you supply via attributes,
156
156
annotations, xml or yaml, so that they do not need to be parsed and
157
157
loaded from scratch on every single request which is a waste of
158
158
resources. The cache implementation must implement the PSR-6
0 commit comments