Skip to content

Commit 4d40e3d

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Reorder DoctrineBundle configuration sections
2 parents 91e201f + 069707a commit 4d40e3d

File tree

1 file changed

+108
-108
lines changed

1 file changed

+108
-108
lines changed

reference/configuration/doctrine.rst

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -270,109 +270,6 @@ Full Default Configuration
270270
</doctrine:config>
271271
</container>
272272
273-
Configuration Overview
274-
----------------------
275-
276-
This following configuration example shows all the configuration defaults
277-
that the ORM resolves to:
278-
279-
.. code-block:: yaml
280-
281-
doctrine:
282-
orm:
283-
auto_mapping: true
284-
# the standard distribution overrides this to be true in debug, false otherwise
285-
auto_generate_proxy_classes: false
286-
proxy_namespace: Proxies
287-
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
288-
default_entity_manager: default
289-
metadata_cache_driver: array
290-
query_cache_driver: array
291-
result_cache_driver: array
292-
293-
There are lots of other configuration options that you can use to overwrite
294-
certain classes, but those are for very advanced use-cases only.
295-
296-
Caching Drivers
297-
~~~~~~~~~~~~~~~
298-
299-
The built-in types of caching drivers are: ``array``, ``apc``, ``apcu``,
300-
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata`` and ``xcache``.
301-
There is a special type called ``service`` which lets you define the ID of your
302-
own caching service.
303-
304-
The following example shows an overview of the caching configurations:
305-
306-
.. code-block:: yaml
307-
308-
doctrine:
309-
orm:
310-
auto_mapping: true
311-
# each caching driver type defines its own config options
312-
metadata_cache_driver: apc
313-
result_cache_driver:
314-
type: memcache
315-
host: localhost
316-
port: 11211
317-
instance_class: Memcache
318-
# the 'service' type requires to define the 'id' option too
319-
query_cache_driver:
320-
type: service
321-
id: my_doctrine_common_cache_service
322-
323-
Mapping Configuration
324-
~~~~~~~~~~~~~~~~~~~~~
325-
326-
Explicit definition of all the mapped entities is the only necessary
327-
configuration for the ORM and there are several configuration options that
328-
you can control. The following configuration options exist for a mapping:
329-
330-
type
331-
....
332-
333-
One of ``annotation``, ``xml``, ``yml``, ``php`` or ``staticphp``. This
334-
specifies which type of metadata type your mapping uses.
335-
336-
dir
337-
...
338-
339-
Path to the mapping or entity files (depending on the driver). If this path
340-
is relative it is assumed to be relative to the bundle root. This only works
341-
if the name of your mapping is a bundle name. If you want to use this option
342-
to specify absolute paths you should prefix the path with the kernel parameters
343-
that exist in the DIC (for example ``%kernel.root_dir%``).
344-
345-
prefix
346-
......
347-
348-
A common namespace prefix that all entities of this mapping share. This
349-
prefix should never conflict with prefixes of other defined mappings otherwise
350-
some of your entities cannot be found by Doctrine. This option defaults
351-
to the bundle namespace + ``Entity``, for example for an application bundle
352-
called AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity``.
353-
354-
alias
355-
.....
356-
357-
Doctrine offers a way to alias entity namespaces to simpler, shorter names
358-
to be used in DQL queries or for Repository access. When using a bundle
359-
the alias defaults to the bundle name.
360-
361-
is_bundle
362-
.........
363-
364-
This option is a derived value from ``dir`` and by default is set to ``true``
365-
if dir is relative proved by a ``file_exists()`` check that returns ``false``.
366-
It is ``false`` if the existence check returns ``true``. In this case an
367-
absolute path was specified and the metadata files are most likely in a
368-
directory outside of a bundle.
369-
370-
.. index::
371-
single: Configuration; Doctrine DBAL
372-
single: Doctrine; DBAL configuration
373-
374-
.. _`reference-dbal-configuration`:
375-
376273
Doctrine DBAL Configuration
377274
---------------------------
378275

@@ -492,8 +389,31 @@ service where ``[name]`` is the name of the connection.
492389

493390
.. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
494391

392+
Doctrine ORM Configuration
393+
--------------------------
394+
395+
This following configuration example shows all the configuration defaults
396+
that the ORM resolves to:
397+
398+
.. code-block:: yaml
399+
400+
doctrine:
401+
orm:
402+
auto_mapping: true
403+
# the standard distribution overrides this to be true in debug, false otherwise
404+
auto_generate_proxy_classes: false
405+
proxy_namespace: Proxies
406+
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
407+
default_entity_manager: default
408+
metadata_cache_driver: array
409+
query_cache_driver: array
410+
result_cache_driver: array
411+
412+
There are lots of other configuration options that you can use to overwrite
413+
certain classes, but those are for very advanced use-cases only.
414+
495415
Shortened Configuration Syntax
496-
------------------------------
416+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
497417

498418
When you are only using one entity manager, all config options available
499419
can be placed directly under ``doctrine.orm`` config level.
@@ -525,8 +445,88 @@ can be placed directly under ``doctrine.orm`` config level.
525445
This shortened version is commonly used in other documentation sections.
526446
Keep in mind that you can't use both syntaxes at the same time.
527447

448+
Caching Drivers
449+
~~~~~~~~~~~~~~~
450+
451+
The built-in types of caching drivers are: ``array``, ``apc``, ``apcu``,
452+
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata`` and ``xcache``.
453+
There is a special type called ``service`` which lets you define the ID of your
454+
own caching service.
455+
456+
The following example shows an overview of the caching configurations:
457+
458+
.. code-block:: yaml
459+
460+
doctrine:
461+
orm:
462+
auto_mapping: true
463+
# each caching driver type defines its own config options
464+
metadata_cache_driver: apc
465+
result_cache_driver:
466+
type: memcache
467+
host: localhost
468+
port: 11211
469+
instance_class: Memcache
470+
# the 'service' type requires to define the 'id' option too
471+
query_cache_driver:
472+
type: service
473+
id: my_doctrine_common_cache_service
474+
475+
Mapping Configuration
476+
~~~~~~~~~~~~~~~~~~~~~
477+
478+
Explicit definition of all the mapped entities is the only necessary
479+
configuration for the ORM and there are several configuration options that
480+
you can control. The following configuration options exist for a mapping:
481+
482+
type
483+
....
484+
485+
One of ``annotation``, ``xml``, ``yml``, ``php`` or ``staticphp``. This
486+
specifies which type of metadata type your mapping uses.
487+
488+
dir
489+
...
490+
491+
Path to the mapping or entity files (depending on the driver). If this path
492+
is relative it is assumed to be relative to the bundle root. This only works
493+
if the name of your mapping is a bundle name. If you want to use this option
494+
to specify absolute paths you should prefix the path with the kernel parameters
495+
that exist in the DIC (for example ``%kernel.root_dir%``).
496+
497+
prefix
498+
......
499+
500+
A common namespace prefix that all entities of this mapping share. This
501+
prefix should never conflict with prefixes of other defined mappings otherwise
502+
some of your entities cannot be found by Doctrine. This option defaults
503+
to the bundle namespace + ``Entity``, for example for an application bundle
504+
called AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity``.
505+
506+
alias
507+
.....
508+
509+
Doctrine offers a way to alias entity namespaces to simpler, shorter names
510+
to be used in DQL queries or for Repository access. When using a bundle
511+
the alias defaults to the bundle name.
512+
513+
is_bundle
514+
.........
515+
516+
This option is a derived value from ``dir`` and by default is set to ``true``
517+
if dir is relative proved by a ``file_exists()`` check that returns ``false``.
518+
It is ``false`` if the existence check returns ``true``. In this case an
519+
absolute path was specified and the metadata files are most likely in a
520+
directory outside of a bundle.
521+
522+
.. index::
523+
single: Configuration; Doctrine DBAL
524+
single: Doctrine; DBAL configuration
525+
526+
.. _`reference-dbal-configuration`:
527+
528528
Custom Mapping Entities in a Bundle
529-
-----------------------------------
529+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530530

531531
Doctrine's ``auto_mapping`` feature loads annotation configuration from
532532
the ``Entity/`` directory of each bundle *and* looks for other formats (e.g.
@@ -587,7 +587,7 @@ directory instead:
587587
));
588588
589589
Mapping Entities Outside of a Bundle
590-
------------------------------------
590+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591591

592592
You can also create new mappings, for example outside of the Symfony folder.
593593

@@ -652,7 +652,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
652652
));
653653
654654
Detecting a Mapping Configuration Format
655-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
655+
........................................
656656

657657
If the ``type`` on the bundle configuration isn't set, the DoctrineBundle
658658
will try to detect the correct mapping configuration format for the bundle.
@@ -671,7 +671,7 @@ root directory. If the folder exist, Doctrine will fall back to using an
671671
annotation driver.
672672

673673
Default Value of Dir
674-
~~~~~~~~~~~~~~~~~~~~
674+
....................
675675

676676
If ``dir`` is not specified, then its default value depends on which configuration
677677
driver is being used. For drivers that rely on the PHP files (annotation,

0 commit comments

Comments
 (0)