Skip to content

Commit d1e794f

Browse files
Rom1deTroyesjaviereguiluz
authored andcommitted
Persisting : forget a \"use\" statement ?
1 parent 7d89756 commit d1e794f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doctrine.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ and save it!
340340
namespace App\Controller;
341341
342342
// ...
343+
use Symfony\Component\HttpFoundation\Response;
344+
343345
use App\Entity\Product;
344346
345347
class ProductController extends AbstractController
@@ -386,17 +388,17 @@ Take a look at the previous example in more detail:
386388

387389
.. _doctrine-entity-manager:
388390

389-
* **line 16** The ``$this->getDoctrine()->getManager()`` method gets Doctrine's
391+
* **line 18** The ``$this->getDoctrine()->getManager()`` method gets Doctrine's
390392
*entity manager* object, which is the most important object in Doctrine. It's
391393
responsible for saving objects to, and fetching objects from, the database.
392394

393-
* **lines 18-21** In this section, you instantiate and work with the ``$product``
395+
* **lines 20-23** In this section, you instantiate and work with the ``$product``
394396
object like any other normal PHP object.
395397

396-
* **line 24** The ``persist($product)`` call tells Doctrine to "manage" the
398+
* **line 26** The ``persist($product)`` call tells Doctrine to "manage" the
397399
``$product`` object. This does **not** cause a query to be made to the database.
398400

399-
* **line 27** When the ``flush()`` method is called, Doctrine looks through
401+
* **line 29** When the ``flush()`` method is called, Doctrine looks through
400402
all of the objects that it's managing to see if they need to be persisted
401403
to the database. In this example, the ``$product`` object's data doesn't
402404
exist in the database, so the entity manager executes an ``INSERT`` query,

0 commit comments

Comments
 (0)