@@ -492,42 +492,35 @@ you can control. The following configuration options exist for a mapping:
492
492
type
493
493
....
494
494
495
- One of ``annotation ``, ``xml ``, ``yml ``, ``php `` or `` staticphp ``. This
496
- specifies which type of metadata type your mapping uses.
495
+ One of ``annotation `` (the default value) , ``xml ``, ``yml ``, ``php `` or
496
+ `` staticphp ``. This specifies which type of metadata type your mapping uses.
497
497
498
498
dir
499
499
...
500
500
501
- Path to the mapping or entity files (depending on the driver). If this path
502
- is relative it is assumed to be relative to the bundle root. This only works
503
- if the name of your mapping is a bundle name. If you want to use this option
504
- to specify absolute paths you should prefix the path with the kernel parameters
505
- that exist in the DIC (for example ``%kernel.project_dir% ``).
501
+ Absolute path to the mapping or entity files (depending on the driver). The
502
+ default value is ``%kernel.project_dir%/src/Entity/ ``.
506
503
507
504
prefix
508
505
......
509
506
510
- A common namespace prefix that all entities of this mapping share. This
511
- prefix should never conflict with prefixes of other defined mappings otherwise
512
- some of your entities cannot be found by Doctrine. This option defaults
513
- to the bundle namespace + ``Entity ``, for example for an application bundle
514
- called AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity ``.
507
+ A common namespace prefix that all entities of this mapping share. This prefix
508
+ should never conflict with prefixes of other defined mappings otherwise some of
509
+ your entities cannot be found by Doctrine. This option defaults to
510
+ ``App\Entity `` because it's recommended to store the entities in ``src/Entity/ ``.
515
511
516
512
alias
517
513
.....
518
514
519
515
Doctrine offers a way to alias entity namespaces to simpler, shorter names
520
- to be used in DQL queries or for Repository access. When using a bundle
521
- the alias defaults to the bundle name.
516
+ to be used in DQL queries or for Repository access. It's default value is ``App ``.
522
517
523
518
is_bundle
524
519
.........
525
520
526
- This option is a derived value from ``dir `` and by default is set to ``true ``
527
- if dir is relative proved by a ``file_exists() `` check that returns ``false ``.
528
- It is ``false `` if the existence check returns ``true ``. In this case an
529
- absolute path was specified and the metadata files are most likely in a
530
- directory outside of a bundle.
521
+ This option is ``false `` by default and it's considered a legacy option. It was
522
+ only useful in previous Symfony versions, when it was recommended to use bundles
523
+ to organize the application code.
531
524
532
525
Custom Mapping Entities in a Bundle
533
526
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -593,9 +586,7 @@ directory instead:
593
586
Mapping Entities Outside of a Bundle
594
587
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
595
588
596
- You can also create new mappings, for example outside of the Symfony folder.
597
-
598
- For example, the following looks for entity classes in the ``App\Entity ``
589
+ For example, the following looks for entity classes in the ``Entity ``
599
590
namespace in the ``src/Entity `` directory and gives them an ``App `` alias
600
591
(so you can say things like ``App:Post ``):
601
592
0 commit comments