19
19
If you prefer to use raw database queries, this is easy, and explained
20
20
in the ":doc: `/cookbook/doctrine/dbal `" cookbook entry.
21
21
22
-
23
- Doctrine doesn't auto-escape reserved SQL keywords, for further reference
24
- check Doctrine manual, `Reserved SQL keywords documentation `_.
25
-
26
-
27
22
You can also persist data to `MongoDB `_ using Doctrine ODM library. For
28
23
more information, read the ":doc: `/cookbook/doctrine/mongodb `" cookbook
29
24
entry.
@@ -234,23 +229,6 @@ in a number of different formats including YAML, XML or directly inside the
234
229
The table name is optional and if omitted, will be determined automatically
235
230
based on the name of the entity class.
236
231
237
- .. tip ::
238
-
239
- When using another library or program (ie. Doxygen) that uses annotations,
240
- you must use the ``@IgnoreAnnotation `` annotation to indicate which annotations
241
- Symfony and Doctrine should ignore. This annotation should be placed in the
242
- comment block of the class it applies to. Failing to do so may result
243
- in an exception being thrown.
244
-
245
- For example, to prevent the ``@fn `` annotation from throwing an exception,
246
- add the following::
247
-
248
- /**
249
- * @IgnoreAnnotation("fn")
250
- *
251
- */
252
- class Product
253
-
254
232
Doctrine allows you to choose from a wide variety of different field types,
255
233
each with their own options. For information on the available field types,
256
234
see the :ref: `book-doctrine-field-types ` section.
@@ -264,6 +242,29 @@ see the :ref:`book-doctrine-field-types` section.
264
242
the ``use Doctrine\ORM\Mapping as ORM; `` statement, which *imports * the
265
243
``ORM `` annotations prefix.
266
244
245
+ .. caution ::
246
+
247
+ Be careful that your class name and properties aren't mapped to a protected
248
+ SQL keyword (such as ``group `` or ``user ``). For example, if your entity
249
+ class name is ``Group ``, then, by default, your table name will be ``group ``,
250
+ which will cause an SQL error in some engines. See Doctrine's
251
+ `Reserved SQL keywords documentation `_ on how to properly escape these
252
+ names.
253
+
254
+ .. note ::
255
+
256
+ When using another library or program (ie. Doxygen) that uses annotations,
257
+ you should place the ``@IgnoreAnnotation `` annotation on the class to
258
+ indicate which annotations Symfony should ignore.
259
+
260
+ For example, to prevent the ``@fn `` annotation from throwing an exception,
261
+ add the following::
262
+
263
+ /**
264
+ * @IgnoreAnnotation("fn")
265
+ */
266
+ class Product
267
+
267
268
Generating Getters and Setters
268
269
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269
270
0 commit comments