@@ -340,6 +340,8 @@ and save it!
340
340
namespace App\Controller;
341
341
342
342
// ...
343
+ use Symfony\Component\HttpFoundation\Response;
344
+
343
345
use App\Entity\Product;
344
346
345
347
class ProductController extends AbstractController
@@ -386,17 +388,17 @@ Take a look at the previous example in more detail:
386
388
387
389
.. _doctrine-entity-manager :
388
390
389
- * **line 16 ** The ``$this->getDoctrine()->getManager() `` method gets Doctrine's
391
+ * **line 18 ** The ``$this->getDoctrine()->getManager() `` method gets Doctrine's
390
392
*entity manager * object, which is the most important object in Doctrine. It's
391
393
responsible for saving objects to, and fetching objects from, the database.
392
394
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 ``
394
396
object like any other normal PHP object.
395
397
396
- * **line 24 ** The ``persist($product) `` call tells Doctrine to "manage" the
398
+ * **line 26 ** The ``persist($product) `` call tells Doctrine to "manage" the
397
399
``$product `` object. This does **not ** cause a query to be made to the database.
398
400
399
- * **line 27 ** When the ``flush() `` method is called, Doctrine looks through
401
+ * **line 29 ** When the ``flush() `` method is called, Doctrine looks through
400
402
all of the objects that it's managing to see if they need to be persisted
401
403
to the database. In this example, the ``$product `` object's data doesn't
402
404
exist in the database, so the entity manager executes an ``INSERT `` query,
0 commit comments