@@ -13,11 +13,16 @@ metadata:
13
13
14
14
15
15
- **XML files ** (XmlDriver)
16
- - **Class DocBlock Annotations ** (AnnotationDriver)
17
16
- **Attributes ** (AttributeDriver)
18
- - **YAML files ** (YamlDriver)
19
17
- **PHP Code in files or static functions ** (PhpDriver)
20
18
19
+ There are also two deprecated ways to do this:
20
+
21
+ - **Class DocBlock Annotations ** (AnnotationDriver)
22
+ - **YAML files ** (YamlDriver)
23
+
24
+ They will be removed in 3.0, make sure to avoid them.
25
+
21
26
Something important to note about the above drivers is they are all
22
27
an intermediate step to the same end result. The mapping
23
28
information is populated to ``Doctrine\ORM\Mapping\ClassMetadata ``
@@ -40,8 +45,9 @@ an entity.
40
45
41
46
42
47
If you want to use one of the included core metadata drivers you need to
43
- configure it. If you pick the annotation driver, you will additionally
44
- need to install ``doctrine/annotations ``. All the drivers are in the
48
+ configure it. If you pick the annotation driver despite it being
49
+ deprecated, you will additionally need to install
50
+ ``doctrine/annotations ``. All the drivers are in the
45
51
``Doctrine\ORM\Mapping\Driver `` namespace:
46
52
47
53
.. code-block :: php
@@ -120,17 +126,17 @@ the ``FileDriver`` implementation for you to extend from:
120
126
* {@inheritdoc}
121
127
*/
122
128
protected $_fileExtension = '.dcm.ext';
123
-
129
+
124
130
/**
125
131
* {@inheritdoc}
126
132
*/
127
133
public function loadMetadataForClass($className, ClassMetadata $metadata)
128
134
{
129
135
$data = $this->_loadMappingFile($file);
130
-
136
+
131
137
// populate ClassMetadata instance from $data
132
138
}
133
-
139
+
134
140
/**
135
141
* {@inheritdoc}
136
142
*/
@@ -198,5 +204,3 @@ iterate over them:
198
204
foreach ($class->fieldMappings as $fieldMapping) {
199
205
echo $fieldMapping['fieldName'] . "\n";
200
206
}
201
-
202
-
0 commit comments