@@ -339,10 +339,8 @@ directly inside the ``Product`` class via DocBlock annotations:
339
339
340
340
.. tip ::
341
341
342
- The table name annotation is optional. If it's omitted, Doctrine will
343
- assume that the entity's class name should double as the database table
344
- name. In the example above, an explicit definition was provided to force
345
- the table name to be lowercased.
342
+ The table name is optional and if omitted, will be determined automatically
343
+ based on the name of the entity class.
346
344
347
345
Doctrine allows you to choose from a wide variety of different field types,
348
346
each with their own options. For information on the available field types,
@@ -362,7 +360,7 @@ see the :ref:`book-doctrine-field-types` section.
362
360
Be careful if the names of your entity classes (or their properties)
363
361
are also reserved SQL keywords like ``GROUP `` or ``USER ``. For example,
364
362
if your entity's class name is ``Group ``, then, by default, the corresponding
365
- table name would be ``Group ``. This will cause an SQL error in some database
363
+ table name would be ``group ``. This will cause an SQL error in some database
366
364
engines. See Doctrine's `Reserved SQL keywords documentation `_ for details
367
365
on how to properly escape these names. Alternatively, if you're free
368
366
to choose your database schema, simply map to a different table name
@@ -507,10 +505,10 @@ a controller, this is pretty easy. Add the following method to the
507
505
508
506
$em = $this->getDoctrine()->getManager();
509
507
510
- // register the Product entity with Doctrine's entity manager.
508
+ // tells Doctrine you want to (eventually) save the Product (no queries yet)
511
509
$em->persist($product);
512
510
513
- // synchronize all the registered entities with the database.
511
+ // actually executes the queries (i.e. the INSERT query)
514
512
$em->flush();
515
513
516
514
return new Response('Saved new product with id '.$product->getId());
0 commit comments