5
5
DoctrineBundle Configuration ("doctrine")
6
6
=========================================
7
7
8
- Full default configuration
8
+ Full Default Configuration
9
9
--------------------------
10
10
11
11
.. configuration-block ::
@@ -180,8 +180,10 @@ Full default configuration
180
180
<container xmlns =" http://symfony.com/schema/dic/services"
181
181
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
182
182
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine"
183
- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
184
- http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
183
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
184
+ http://symfony.com/schema/dic/services/services-1.0.xsd
185
+ http://symfony.com/schema/dic/doctrine
186
+ http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
185
187
186
188
<doctrine : config >
187
189
<doctrine : dbal default-connection =" default" >
@@ -209,16 +211,44 @@ Full default configuration
209
211
<doctrine : type name =" custom" >Acme\HelloBundle\MyCustomType</doctrine : type >
210
212
</doctrine : dbal >
211
213
212
- <doctrine : orm default-entity-manager =" default" auto-generate-proxy-classes =" false" proxy-namespace =" Proxies" proxy-dir =" %kernel.cache_dir%/doctrine/orm/Proxies" >
213
- <doctrine : entity-manager name =" default" query-cache-driver =" array" result-cache-driver =" array" connection =" conn1" class-metadata-factory-name =" Doctrine\ORM\Mapping\ClassMetadataFactory" >
214
- <doctrine : metadata-cache-driver type =" memcache" host =" localhost" port =" 11211" instance-class =" Memcache" class =" Doctrine\Common\Cache\MemcacheCache" />
214
+ <doctrine : orm
215
+ default-entity-manager =" default"
216
+ auto-generate-proxy-classes =" false"
217
+ proxy-namespace =" Proxies"
218
+ proxy-dir =" %kernel.cache_dir%/doctrine/orm/Proxies"
219
+ >
220
+ <doctrine : entity-manager
221
+ name =" default"
222
+ query-cache-driver =" array"
223
+ result-cache-driver =" array"
224
+ connection =" conn1"
225
+ class-metadata-factory-name =" Doctrine\ORM\Mapping\ClassMetadataFactory"
226
+ >
227
+ <doctrine : metadata-cache-driver
228
+ type =" memcache"
229
+ host =" localhost"
230
+ port =" 11211"
231
+ instance-class =" Memcache"
232
+ class =" Doctrine\Common\Cache\MemcacheCache"
233
+ />
234
+
215
235
<doctrine : mapping name =" AcmeHelloBundle" />
236
+
216
237
<doctrine : dql >
217
- <doctrine : string-function name =" test_string" >Acme\HelloBundle\DQL\StringFunction</doctrine : string-function >
218
- <doctrine : numeric-function name =" test_numeric" >Acme\HelloBundle\DQL\NumericFunction</doctrine : numeric-function >
219
- <doctrine : datetime-function name =" test_datetime" >Acme\HelloBundle\DQL\DatetimeFunction</doctrine : datetime-function >
238
+ <doctrine : string-function name =" test_string" >
239
+ Acme\HelloBundle\DQL\StringFunction
240
+ </doctrine : string-function >
241
+
242
+ <doctrine : numeric-function name =" test_numeric" >
243
+ Acme\HelloBundle\DQL\NumericFunction
244
+ </doctrine : numeric-function >
245
+
246
+ <doctrine : datetime-function name =" test_datetime" >
247
+ Acme\HelloBundle\DQL\DatetimeFunction
248
+ </doctrine : datetime-function >
220
249
</doctrine : dql >
221
250
</doctrine : entity-manager >
251
+
222
252
<doctrine : entity-manager name =" em2" connection =" conn2" metadata-cache-driver =" apc" >
223
253
<doctrine : mapping
224
254
name =" DoctrineExtensions"
@@ -235,8 +265,8 @@ Full default configuration
235
265
Configuration Overview
236
266
----------------------
237
267
238
- This following configuration example shows all the configuration defaults that
239
- the ORM resolves to:
268
+ This following configuration example shows all the configuration defaults
269
+ that the ORM resolves to:
240
270
241
271
.. code-block :: yaml
242
272
@@ -258,8 +288,8 @@ certain classes, but those are for very advanced use-cases only.
258
288
Caching Drivers
259
289
~~~~~~~~~~~~~~~
260
290
261
- For the caching drivers you can specify the values "array", "apc", "memcache", "memcached",
262
- "xcache" or "service".
291
+ For the caching drivers you can specify the values "array", "apc", "memcache",
292
+ "memcached", " xcache" or "service".
263
293
264
294
The following example shows an overview of the caching configurations:
265
295
@@ -282,34 +312,34 @@ Mapping Configuration
282
312
~~~~~~~~~~~~~~~~~~~~~
283
313
284
314
Explicit definition of all the mapped entities is the only necessary
285
- configuration for the ORM and there are several configuration options that you
286
- can control. The following configuration options exist for a mapping:
315
+ configuration for the ORM and there are several configuration options that
316
+ you can control. The following configuration options exist for a mapping:
287
317
288
318
* ``type `` One of ``annotation ``, ``xml ``, ``yml ``, ``php `` or ``staticphp ``.
289
319
This specifies which type of metadata type your mapping uses.
290
320
291
- * ``dir `` Path to the mapping or entity files (depending on the driver). If
292
- this path is relative it is assumed to be relative to the bundle root. This
293
- only works if the name of your mapping is a bundle name. If you want to use
294
- this option to specify absolute paths you should prefix the path with the
295
- kernel parameters that exist in the DIC (for example %kernel.root_dir%).
321
+ * ``dir `` Path to the mapping or entity files (depending on the driver).
322
+ If this path is relative it is assumed to be relative to the bundle root.
323
+ This only works if the name of your mapping is a bundle name. If you want
324
+ to use this option to specify absolute paths you should prefix the path
325
+ with the kernel parameters that exist in the DIC (for example `` %kernel.root_dir% `` ).
296
326
297
327
* ``prefix `` A common namespace prefix that all entities of this mapping
298
328
share. This prefix should never conflict with prefixes of other defined
299
- mappings otherwise some of your entities cannot be found by Doctrine. This
300
- option defaults to the bundle namespace + ``Entity ``, for example for an
301
- application bundle called ``AcmeHelloBundle `` prefix would be
329
+ mappings otherwise some of your entities cannot be found by Doctrine.
330
+ This option defaults to the bundle namespace + ``Entity ``, for example
331
+ for an application bundle called ``AcmeHelloBundle `` prefix would be
302
332
``Acme\HelloBundle\Entity ``.
303
333
304
334
* ``alias `` Doctrine offers a way to alias entity namespaces to simpler,
305
- shorter names to be used in DQL queries or for Repository access. When using
306
- a bundle the alias defaults to the bundle name.
335
+ shorter names to be used in DQL queries or for Repository access. When
336
+ using a bundle the alias defaults to the bundle name.
307
337
308
- * ``is_bundle `` This option is a derived value from ``dir `` and by default is
309
- set to true if dir is relative proved by a ``file_exists() `` check that
310
- returns false. It is false if the existence check returns true. In this case
311
- an absolute path was specified and the metadata files are most likely in a
312
- directory outside of a bundle.
338
+ * ``is_bundle `` This option is a derived value from ``dir `` and by default
339
+ is set to true if dir is relative proved by a ``file_exists() `` check
340
+ that returns false. It is false if the existence check returns true. In
341
+ this case an absolute path was specified and the metadata files are most
342
+ likely in a directory outside of a bundle.
313
343
314
344
.. index ::
315
345
single: Configuration; Doctrine DBAL
@@ -363,8 +393,11 @@ The following block shows all possible configuration keys:
363
393
<container xmlns =" http://symfony.com/schema/dic/services"
364
394
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
365
395
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine"
366
- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
367
- http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
396
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
397
+ http://symfony.com/schema/dic/services/services-1.0.xsd
398
+ http://symfony.com/schema/dic/doctrine
399
+ http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"
400
+ >
368
401
369
402
<doctrine : config >
370
403
<doctrine : dbal
0 commit comments