8000 [#6360] Minor changes · fabpot/symfony-docs@10d19ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 10d19ba

Browse files
committed
[symfony#6360] Minor changes
1 parent 8883dfe commit 10d19ba

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

book/doctrine.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,8 @@ directly inside the ``Product`` class via DocBlock annotations:
339339

340340
.. tip::
341341

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.
346344

347345
Doctrine allows you to choose from a wide variety of different field types,
348346
each with their own options. For information on the available field types,
@@ -362,7 +360,7 @@ see the :ref:`book-doctrine-field-types` section.
362360
Be careful if the names of your entity classes (or their properties)
363361
are also reserved SQL keywords like ``GROUP`` or ``USER``. For example,
364362
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
366364
engines. See Doctrine's `Reserved SQL keywords documentation`_ for details
367365
on how to properly escape these names. Alternatively, if you're free
368366
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
507505

508506
$em = $this->getDoctrine()->getManager();
509507

510-
// register the Product entity with Doctrine's entity manager.
508+
// tells Doctrine you want to (eventually) save the Product (no queries yet)
511509
$em->persist($product);
512510

513-
// synchronize all the registered entities with the database.
511+
// actually executes the queries (i.e. the INSERT query)
514512
$em->flush();
515513

516514
return new Response('Saved new product with id '.$product->getId());

0 commit comments

Comments
 (0)
0