Skip to content

Commit 1dbbdbe

Browse files
committed
fixed markup
1 parent c8cb740 commit 1dbbdbe

File tree

2 files changed

+91
-76
lines changed

2 files changed

+91
-76
lines changed

guides/doctrine/mongodb-odm/configuration.rst

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,41 @@ If you wish to use memcache to cache your metadata, you need to configure the
3636
Mapping Configuration
3737
~~~~~~~~~~~~~~~~~~~~~
3838

39-
Explicit definition of all the mapped documents is the only necessary configuration for the ODM and there
40-
are several configuration options that you can control. The following configuration options exist
41-
for a mapping:
42-
43-
- ``type`` One of "annotations", "xml", "yml", "php" or "static-php". This specifies which type
44-
of metadata type your mapping uses.
45-
- ``dir`` Path to the mapping or entity files (depending on the driver). If this path is relative
46-
it is assumed to be relative to the bundle root. This only works if the name of your mapping
47-
is a bundle name. If you want to use this option to specifiy absolute paths you should prefix
48-
the path with the kernel parameters that exist in the DIC (for example %kernel.dir%).
49-
- ``prefix`` A common namespace prefix that all documents of this mapping share. This prefix
50-
should never conflict with prefixes of other defined mappings otherwise some of your documents cannot be found
51-
by Doctrine. This option defaults to the bundle namespace + `Documents`, for example for an
52-
application bundle called "Hello" prefix would be "Application\Hello\Documents".
53-
- ``alias`` Doctrine offers a way to alias document namespaces to simpler, shorter names to be used
54-
inqueries or for Repository access.
55-
- ``is_bundle`` This option is a derived value from ``dir`` and by default is set to true if dir is relative
56-
proved by a ``file_exists()`` check that returns false. It is false if the existance check returns true.
57-
In this case an absolute path was specified and the metadata files are most likely in a directory outside of
58-
a bundle.
59-
60-
To avoid having to configure lots of information for your mappings you should follow these conventions:
61-
62-
1. Put all your entities in a directory Documents/ inside your bundle. For example "Application/Hello/Documents/".
63-
2. If you are using xml, yml or php mapping put all your configuration files into the
64-
"Resources/config/doctrine/metadata/doctrine/mongodb/" directory sufficed with dcm.xml, dcm.yml or dcm.php
65-
respectively.
66-
3. Annotations is assumed if an "Documents/" but no "Resources/config/doctrine/metadata/doctrine/mongodb/"
67-
directory is found.
39+
Explicit definition of all the mapped documents is the only necessary
40+
configuration for the ODM and there are several configuration options that you
41+
can control. The following configuration options exist for a mapping:
42+
43+
- ``type`` One of "annotations", "xml", "yml", "php" or "static-php". This
44+
specifies which type of metadata type your mapping uses.
45+
- ``dir`` Path to the mapping or entity files (depending on the driver). If
46+
this path is relative it is assumed to be relative to the bundle root. This
47+
only works if the name of your mapping is a bundle name. If you want to use
48+
this option to specifiy absolute paths you should prefix the path with the
49+
kernel parameters that exist in the DIC (for example %kernel.dir%).
50+
- ``prefix`` A common namespace prefix that all documents of this mapping
51+
share. This prefix should never conflict with prefixes of other defined
52+
mappings otherwise some of your documents cannot be found by Doctrine. This
53+
option defaults to the bundle namespace + `Documents`, for example for an
54+
application bundle called "Hello" prefix would be
55+
"Application\Hello\Documents".
56+
- ``alias`` Doctrine offers a way to alias document namespaces to simpler,
57+
shorter names to be used inqueries or for Repository access.
58+
- ``is_bundle`` This option is a derived value from ``dir`` and by default is
59+
set to true if dir is relative proved by a ``file_exists()`` check that
60+
returns false. It is false if the existance check returns true. In this case
61+
an absolute path was specified and the metadata files are most likely in a
62+
directory outside of a bundle.
63+
64+
To avoid having to configure lots of information for your mappings you should
65+
follow these conventions:
66+
67+
1. Put all your entities in a directory Documents/ inside your bundle. For
68+
example "Application/Hello/Documents/".
69+
2. If you are using xml, yml or php mapping put all your configuration files
70+
into the "Resources/config/doctrine/metadata/doctrine/mongodb/" directory
71+
sufficed with dcm.xml, dcm.yml or dcm.php respectively.
72+
3. Annotations is assumed if an "Documents/" but no
73+
"Resources/config/doctrine/metadata/doctrine/mongodb/" directory is found.
6874

6975
The following configuration shows a bunch of mapping examples:
7076

@@ -129,8 +135,8 @@ connection services::
129135
XML
130136
~~~
131137

132-
You can specify the same configuration via XML if you prefer that. Here are the
133-
same examples from above in XML.
138+
You can specify the same configuration via XML if you prefer that. Here are
139+
the same examples from above in XML.
134140

135141
Simple Single Connection:
136142

guides/doctrine/orm/configuration.rst

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
Configuration
66
=============
77

8-
In the overview we already described the only necessary configuration option "mappings"
9-
to get the Doctrine ORM running with Symfony 2. All the other configuration options are
10-
used with reasonable default values.
8+
In the overview we already described the only necessary configuration option
9+
"mappings" to get the Doctrine ORM running with Symfony 2. All the other
10+
configuration options are used with reasonable default values.
1111

12-
This following configuration example shows all the configuration defaults that the ORM resolves to:
12+
This following configuration example shows all the configuration defaults that
13+
the ORM resolves to:
1314

1415
.. code-block:: yaml
1516
@@ -25,11 +26,13 @@ This following configuration example shows all the configuration defaults that t
2526
query_cache_driver: array
2627
result_cache_driver: array
2728
28-
There are lots of other configuration options that you can use to overwrite certain classes, but those
29-
are for very advanced use-cases only. You should look at the "orm.xml" file in the DoctrineBundle to
30-
get an overview of all the supported options.
29+
There are lots of other configuration options that you can use to overwrite
30+
certain classes, but those are for very advanced use-cases only. You should
31+
look at the "orm.xml" file in the DoctrineBundle to get an overview of all the
32+
supported options.
3133

32-
For the caching drivers you can specifiy the values "array", "apc", "memcache" or "xcache".
34+
For the caching drivers you can specifiy the values "array", "apc", "memcache"
35+
or "xcache".
3336

3437
The following example shows an overview of the caching configurations:
3538

@@ -49,35 +52,41 @@ The following example shows an overview of the caching configurations:
4952
Mapping Configuration
5053
~~~~~~~~~~~~~~~~~~~~~
5154

52-
Explicit definition of all the mapped entities is the only necessary configuration for the ORM and there
53-
are several configuration options that you can control. The following configuration options exist
54-
for a mapping:
55-
56-
- ``type`` One of "annotations", "xml", "yml", "php" or "static-php". This specifies which type
57-
of metadata type your mapping uses.
58-
- ``dir`` Path to the mapping or entity files (depending on the driver). If this path is relative
59-
it is assumed to be relative to the bundle root. This only works if the name of your mapping
60-
is a bundle name. If you want to use this option to specifiy absolute paths you should prefix
61-
the path with the kernel parameters that exist in the DIC (for example %kernel.dir%).
62-
- ``prefix`` A common namespace prefix that all entities of this mapping share. This prefix
63-
should never conflict with prefixes of other defined mappings otherwise some of your entities cannot be found
64-
by Doctrine. This option defaults to the bundle namespace + `Entities`, for example for an
65-
application bundle called "Hello" prefix would be "Application\Hello\Entities".
66-
- ``alias`` Doctrine offers a way to alias entity namespaces to simpler, shorter names to be used
67-
in DQL queries or for Repository access.
68-
- ``is_bundle`` This option is a derived value from ``dir`` and by default is set to true if dir is relative
69-
proved by a ``file_exists()`` check that returns false. It is false if the existance check returns true.
70-
In this case an absolute path was specified and the metadata files are most likely in a directory outside of
71-
a bundle.
72-
73-
To avoid having to configure lots of information for your mappings you should follow these conventions:
74-
75-
1. Put all your entities in a directory Entities/ inside your bundle. For example "Application/Hello/Entities/".
76-
2. If you are using xml, yml or php mapping put all your configuration files into the
77-
"Resources/config/doctrine/metadata/doctrine/orm/" directory sufficed with dcm.xml, dcm.yml or dcm.php
78-
respectively.
79-
3. Annotations is assumed if an "Entities/" but no "Resources/config/doctrine/metadata/doctrine/orm/"
80-
directory is found.
55+
Explicit definition of all the mapped entities is the only necessary
56+
configuration for the ORM and there are several configuration options that you
57+
can control. The following configuration options exist for a mapping:
58+
59+
- ``type`` One of "annotations", "xml", "yml", "php" or "static-php". This
60+
specifies which type of metadata type your mapping uses.
61+
- ``dir`` Path to the mapping or entity files (depending on the driver). If
62+
this path is relative it is assumed to be relative to the bundle root. This
63+
only works if the name of your mapping is a bundle name. If you want to use
64+
this option to specifiy absolute paths you should prefix the path with the
65+
kernel parameters that exist in the DIC (for example %kernel.dir%).
66+
- ``prefix`` A common namespace prefix that all entities of this mapping
67+
share. This prefix should never conflict with prefixes of other defined
68+
mappings otherwise some of your entities cannot be found by Doctrine. This
69+
option defaults to the bundle namespace + `Entities`, for example for an
70+
application bundle called "Hello" prefix would be
71+
"Application\Hello\Entities".
72+
- ``alias`` Doctrine offers a way to alias entity namespaces to simpler,
73+
shorter names to be used in DQL queries or for Repository access.
74+
- ``is_bundle`` This option is a derived value from ``dir`` and by default is
75+
set to true if dir is relative proved by a ``file_exists()`` check that
76+
returns false. It is false if the existance check returns true. In this case
77+
an absolute path was specified and the metadata files are most likely in a
78+
directory outside of a bundle.
79+
80+
To avoid having to configure lots of information for your mappings you should
81+
follow these conventions:
82+
83+
1. Put all your entities in a directory Entities/ inside your bundle. For
84+
example "Application/Hello/Entities/".
85+
2. If you are using xml, yml or php mapping put all your configuration files
86+
into the "Resources/config/doctrine/metadata/doctrine/orm/" directory sufficed
87+
with dcm.xml, dcm.yml or dcm.php respectively.
88+
3. Annotations is assumed if an "Entities/" but no
89+
"Resources/config/doctrine/metadata/doctrine/orm/" directory is found.
8190

8291
The following configuration shows a bunch of mapping examples:
8392

@@ -102,9 +111,9 @@ The following configuration shows a bunch of mapping examples:
102111
Multiple Entity Managers
103112
~~~~~~~~~~~~~~~~~~~~~~~~
104113

105-
You can use multiple EntityManagers in a Symfony application. This is necessary
106-
if you are using different databases or even vendors with entirely different sets
107-
of entities.
114+
You can use multiple EntityManagers in a Symfony application. This is
115+
necessary if you are using different databases or even vendors with entirely
116+
different sets of entities.
108117

109118
The following configuration code shows how to define two EntityManagers:
110119

@@ -119,9 +128,9 @@ The following configuration code shows how to define two EntityManagers:
119128
customer:
120129
connection: customer
121130
122-
Just like the DBAL, if you have configured multiple ``EntityManager`` instances
123-
and want to get a specific one you can use the full service name to retrieve
124-
it from the Symfony Dependency Injection Container:
131+
Just like the DBAL, if you have configured multiple ``EntityManager``
132+
instances and want to get a specific one you can use the full service name to
133+
retrieve it from the Symfony Dependency Injection Container::
125134

126135
class UserController extends Controller
127136
{
@@ -136,5 +145,5 @@ it from the Symfony Dependency Injection Container:
136145
}
137146
}
138147

139-
The service "doctrine.orm.entity_manager" is an alias for the default entity manager
140-
defined in the "default_entity_manager" configuration option.
148+
The service "doctrine.orm.entity_manager" is an alias for the default entity
149+
manager defined in the "default_entity_manager" configuration option.

0 commit comments

Comments
 (0)