Skip to content

Commit 39c4a83

Browse files
committed
fixes thanks to the team!
1 parent 04603c7 commit 39c4a83

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

doctrine.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ database for you:
4848
4949
$ php bin/console doctrine:database:create
5050
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,
5252
including your ``server_version`` (e.g. 5.7 if you're using MySQL 5.7), which may
5353
affect how Doctrine functions.
5454

5555
.. tip::
5656

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

6060
Creating an Entity Class
6161
------------------------
@@ -178,7 +178,8 @@ in the database. This is usually done with annotations:
178178
179179
Doctrine supports a wide variety of different field types, each with their own options.
180180
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
182183
``config/packages/doctrine.yaml`` file.
183184

184185
.. caution::
@@ -363,7 +364,7 @@ Try it out!
363364

364365
http://localhost:8000/product
365366

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,
367368
you can query the database directly:
368369

369370
.. code-block:: terminal
@@ -589,7 +590,7 @@ But what if you need a more complex query? When you generated your entity with
589590
}
590591
}
591592

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
593594
*actually* an instance of *this* object! This is because of the ``repositoryClass``
594595
config that was generated at the top of your ``Product`` entity class.
595596

@@ -601,7 +602,10 @@ a new method for this to your repository::
601602
// ...
602603
class ProductRepository extends ServiceEntityRepository
603604
{
604-
// ...
605+
public function __construct(RegistryInterface $registry)
606+
{
607+
parent::__construct($registry, Product::class);
608+
}
605609

606610
/**
607611
* @param $price

doctrine/associations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ What's important is the fact that you have easy access to the product's related
335335
category, but the category data isn't actually retrieved until you ask for
336336
the category (i.e. it's "lazily loaded").
337337

338-
Because we mapped the optiona ``OneToMany`` side, you can also query in the other
338+
Because we mapped the optional ``OneToMany`` side, you can also query in the other
339339
direction::
340340

341341
public function showProductsAction($id)

doctrine/dbal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To get started, configure the ``DATABASE_URL`` environment variable in ``.env``:
2828
# .env
2929
3030
# customize this line!
31-
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?charset=utf8mb4&serverVersion=5.7"
31+
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name"
3232
3333
Further things can be configured in ``config/packages/doctrine.yaml``. For the full
3434
DBAL configuration options, or to learn how to configure multiple connections,

0 commit comments

Comments
 (0)