@@ -324,8 +324,8 @@ you can control. The following configuration options exist for a mapping:
324324type
325325....
326326
327- One of ``annotation ``, ``xml ``, ``yml ``, ``php `` or ``staticphp ``. This specifies
328- which type of metadata type your mapping uses.
327+ One of ``annotation ``, ``xml ``, ``yml ``, ``php `` or ``staticphp ``. This
328+ specifies which type of metadata type your mapping uses.
329329
330330dir
331331...
@@ -339,27 +339,27 @@ that exist in the DIC (for example ``%kernel.root_dir%``).
339339prefix
340340......
341341
342- A common namespace prefix that all entities of this mapping share. This prefix
343- should never conflict with prefixes of other defined mappings otherwise some
344- of your entities cannot be found by Doctrine. This option defaults to the
345- bundle namespace + ``Entity ``, for example for an application bundle called
346- AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity ``.
342+ A common namespace prefix that all entities of this mapping share. This
343+ prefix should never conflict with prefixes of other defined mappings otherwise
344+ some of your entities cannot be found by Doctrine. This option defaults
345+ to the bundle namespace + ``Entity ``, for example for an application bundle
346+ called AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity ``.
347347
348348alias
349349.....
350350
351351Doctrine offers a way to alias entity namespaces to simpler, shorter names
352- to be used in DQL queries or for Repository access. When using a bundle the
353- alias defaults to the bundle name.
352+ to be used in DQL queries or for Repository access. When using a bundle
353+ the alias defaults to the bundle name.
354354
355355is_bundle
356356.........
357357
358358This option is a derived value from ``dir `` and by default is set to ``true ``
359359if dir is relative proved by a ``file_exists() `` check that returns ``false ``.
360360It is ``false `` if the existence check returns ``true ``. In this case an
361- absolute path was specified and the metadata files are most likely in a directory
362- outside of a bundle.
361+ absolute path was specified and the metadata files are most likely in a
362+ directory outside of a bundle.
363363
364364.. index ::
365365 single: Configuration; Doctrine DBAL
@@ -448,14 +448,15 @@ The following block shows all possible configuration keys:
448448
449449 .. note ::
450450
451- The ``server_version `` option was added in Doctrine DBAL 2.5, which is used
452- by DoctrineBundle 1.3. The value of this option should match your database
453- server version (use ``postgres -V `` or ``psql -V `` command to find
454- your PostgreSQL version and ``mysql -V `` to get your MySQL version).
451+ The ``server_version `` option was added in Doctrine DBAL 2.5, which
452+ is used by DoctrineBundle 1.3. The value of this option should match
453+ your database server version (use ``postgres -V `` or ``psql -V `` command
454+ to find your PostgreSQL version and ``mysql -V `` to get your MySQL
455+ version).
455456
456- If you don't define this option and you haven't created your database yet,
457- you may get ``PDOException `` errors because Doctrine will try to guess the
458- database server version automatically and none is available.
457+ If you don't define this option and you haven't created your database
458+ yet, you may get ``PDOException `` errors because Doctrine will try to
459+ guess the database server version automatically and none is available.
459460
460461If you want to configure multiple connections in YAML, put them under the
461462``connections `` key and give them a unique name:
@@ -524,24 +525,26 @@ Keep in mind that you can't use both syntaxes at the same time.
524525Custom Mapping Entities in a Bundle
525526-----------------------------------
526527
527- Doctrine's ``auto_mapping `` feature loads annotation configuration from the
528- ``Entity/ `` directory of each bundle *and * looks for other formats (e.g. YAML, XML)
529- in the ``Resources/config/doctrine `` directory.
528+ Doctrine's ``auto_mapping `` feature loads annotation configuration from
529+ the ``Entity/ `` directory of each bundle *and * looks for other formats (e.g.
530+ YAML, XML) in the ``Resources/config/doctrine `` directory.
530531
531- If you store metadata somewhere else in your bundle, you can define your own mappings,
532- where you tell Doctrine exactly *where * to look, along with some other configurations.
532+ If you store metadata somewhere else in your bundle, you can define your
533+ own mappings, where you tell Doctrine exactly *where * to look, along with
534+ some other configurations.
533535
534- If you're using the ``auto_mapping `` configuration, you just need to overwrite the
535- configurations you want. In this case it's important that the key of the mapping
536- configurations corresponds to the name of the bundle.
536+ If you're using the ``auto_mapping `` configuration, you just need to overwrite
537+ the configurations you want. In this case it's important that the key of
538+ the mapping configurations corresponds to the name of the bundle.
537539
538- For example, suppose you decide to store your ``XML `` configuration for ``AppBundle `` entities
539- in the ``@AppBundle/SomeResources/config/doctrine `` directory instead:
540+ For example, suppose you decide to store your ``XML `` configuration for
541+ ``AppBundle `` entities in the ``@AppBundle/SomeResources/config/doctrine ``
542+ directory instead:
540543
541544.. configuration-block ::
542545
543546 .. code-block :: yaml
544-
547+
545548 doctrine :
546549 # ...
547550 orm :
@@ -552,22 +555,22 @@ in the ``@AppBundle/SomeResources/config/doctrine`` directory instead:
552555 AppBundle :
553556 type : xml
554557 dir : SomeResources/config/doctrine
555-
558+
556559 .. code-block :: xml
557-
560+
558561 <?xml version =" 1.0" charset =" UTF-8" ?>
559562 <container xmlns =" http://symfony.com/schema/dic/services"
560563 xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
561-
564+
562565 <doctrine : config >
563566 <doctrine : orm auto-mapping =" true" >
564567 <mapping name =" AppBundle" dir =" SomeResources/config/doctrine" type =" xml" />
565568 </doctrine : orm >
566569 </doctrine : config >
567570 </container >
568-
571+
569572 .. code-block :: php
570-
573+
571574 $container->loadFromExtension('doctrine', array(
572575 'orm' => array(
573576 'auto_mapping' => true,
@@ -582,13 +585,14 @@ Mapping Entities Outside of a Bundle
582585
583586You can also create new mappings, for example outside of the Symfony folder.
584587
585- For example, the following looks for entity classes in the ``App\Entity `` namespace in the
586- ``src/Entity `` directory and gives them an ``App `` alias (so you can say things like ``App:Post ``):
588+ For example, the following looks for entity classes in the ``App\Entity ``
589+ namespace in the ``src/Entity `` directory and gives them an ``App `` alias
590+ (so you can say things like ``App:Post ``):
587591
588592.. configuration-block ::
589593
590594 .. code-block :: yaml
591-
595+
592596 doctrine :
593597 # ...
594598 orm :
@@ -601,16 +605,16 @@ For example, the following looks for entity classes in the ``App\Entity`` namesp
601605 is_bundle : false
602606 prefix : App\Entity
603607 alias : App
604-
608+
605609 .. code-block :: xml
606-
610+
607611 <?xml version =" 1.0" charset =" UTF-8" ?>
608612 <container xmlns =" http://symfony.com/schema/dic/services"
609613 xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
610-
614+
611615 <doctrine : config >
612616 <doctrine : orm >
613- <mapping name =" SomeEntityNamespace"
617+ <mapping name =" SomeEntityNamespace"
614618 type =" annotation"
615619 dir =" %kernel.root_dir%/../src/Entity"
616620 is-bundle =" false"
@@ -620,9 +624,9 @@ For example, the following looks for entity classes in the ``App\Entity`` namesp
620624 </doctrine : orm >
621625 </doctrine : config >
622626 </container >
623-
627+
624628 .. code-block :: php
625-
629+
626630 $container->loadFromExtension('doctrine', array(
627631 'orm' => array(
628632 'auto_mapping' => true,
@@ -641,31 +645,33 @@ For example, the following looks for entity classes in the ``App\Entity`` namesp
641645 Detecting a Mapping Configuration Format
642646~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
643647
644- If the ``type `` on the bundle configuration isn't set,
645- the DoctrineBundle will try to detect the correct mapping configuration format for
646- the bundle.
648+ If the ``type `` on the bundle configuration isn't set, the DoctrineBundle
649+ will try to detect the correct mapping configuration format for the bundle.
647650
648- DoctrineBundle will look for files matching ``*.orm.[FORMAT] `` (e.g. `` Post.orm.yml ``)
649- in the configured ``dir `` of your mapping (if you're mapping a bundle, then `` dir `` is
650- relative to the bundle's directory).
651+ DoctrineBundle will look for files matching ``*.orm.[FORMAT] `` (e.g.
652+ `` Post.orm.yml ``) in the configured ``dir `` of your mapping (if you're mapping
653+ a bundle, then `` dir `` is relative to the bundle's directory).
651654
652655The bundle looks for (in this order) XML, YAML and PHP files.
653- Using the ``auto_mapping `` feature, every bundle can have only one configuration format.
654- The bundle will stop as soon as it locates one.
656+ Using the ``auto_mapping `` feature, every bundle can have only one
657+ configuration format. The bundle will stop as soon as it locates one.
655658
656659If it wasn't possible to determine a configuration format for a bundle,
657- the DoctrineBundle will check if there is an ``Entity `` folder in the bundle's root directory.
658- If the folder exist, Doctrine will fall back to using an annotation driver.
660+ the DoctrineBundle will check if there is an ``Entity `` folder in the bundle's
661+ root directory. If the folder exist, Doctrine will fall back to using an
662+ annotation driver.
659663
660- Default Value of dir
664+ Default Value of Dir
661665~~~~~~~~~~~~~~~~~~~~
662666
663- If ``dir `` is not specified, then its default value depends on which configuration driver is being used.
664- For drivers that rely on the PHP files (annotation, staticphp) it will
665- be ``[Bundle]/Entity ``. For drivers that are using configuration
666- files (XML, YAML, ...) it will be ``[Bundle]/Resources/config/doctrine ``.
667+ If ``dir `` is not specified, then its default value depends on which configuration
668+ driver is being used. For drivers that rely on the PHP files (annotation,
669+ staticphp) it will be ``[Bundle]/Entity ``. For drivers that are using
670+ configuration files (XML, YAML, ...) it will be
671+ ``[Bundle]/Resources/config/doctrine ``.
667672
668- If the ``dir `` configuration is set and the ``is_bundle `` configuration is ``true ``,
669- the DoctrineBundle will prefix the ``dir `` configuration with the path of the bundle.
673+ If the ``dir `` configuration is set and the ``is_bundle `` configuration
674+ is ``true ``, the DoctrineBundle will prefix the ``dir `` configuration with
675+ the path of the bundle.
670676
671677.. _`DQL User Defined Functions` : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html
0 commit comments