@@ -48,14 +48,14 @@ database for you:
48
48
49
49
$ php bin/console doctrine:database:create
50
50
51
- There are more optiosn in ``config/packages/doctrine.yaml `` that you can configure,
51
+ There are more options in ``config/packages/doctrine.yaml `` that you can configure,
52
52
including your ``server_version `` (e.g. 5.7 if you're using MySQL 5.7), which may
53
53
affect how Doctrine functions.
54
54
55
55
.. tip ::
56
56
57
- There are many other Doctrine commands. To see a full list, run
58
- `` php bin/console list doctrine `` .
57
+ There are many other Doctrine commands. Run `` php bin/console list doctrine ``
58
+ to see a full list .
59
59
60
60
Creating an Entity Class
61
61
------------------------
@@ -178,7 +178,8 @@ in the database. This is usually done with annotations:
178
178
179
179
Doctrine supports a wide variety of different field types, each with their own options.
180
180
To see a full list of types and options, see `Doctrine's Mapping Types documentation `_.
181
- If you want to use ``xml `` instead of annotations, you'll need to configure this in your
181
+ If you want to use XML instead of annotations, add ``type: xml `` and
182
+ ``dir: '%kernel.project_dir%/config/doctrine `` to the entity mappings in your
182
183
``config/packages/doctrine.yaml `` file.
183
184
184
185
.. caution ::
@@ -363,7 +364,7 @@ Try it out!
363
364
364
365
http://localhost:8000/product
365
366
366
- Congratulations! You just created your first row the ``product `` table. To prove it,
367
+ Congratulations! You just created your first row in the ``product `` table. To prove it,
367
368
you can query the database directly:
368
369
369
370
.. code-block :: terminal
@@ -589,7 +590,7 @@ But what if you need a more complex query? When you generated your entity with
589
590
}
590
591
}
591
592
592
- When you fetch your repository (i.e. ``->getRepository(Product::class) ``, it is
593
+ When you fetch your repository (i.e. ``->getRepository(Product::class) ``) , it is
593
594
*actually * an instance of *this * object! This is because of the ``repositoryClass ``
594
595
config that was generated at the top of your ``Product `` entity class.
595
596
@@ -601,7 +602,10 @@ a new method for this to your repository::
601
602
// ...
602
603
class ProductRepository extends ServiceEntityRepository
603
604
{
604
- // ...
605
+ public function __construct(RegistryInterface $registry)
606
+ {
607
+ parent::__construct($registry, Product::class);
608
+ }
605
609
606
610
/**
607
611
* @param $price
0 commit comments