Persistence
The CoreBundle lets you to centrally configure the persistence layer for all CMF bundles.
To make the PHPCR-ODM the default persistence layer for all CMF bundles add the following to your main configuration file:
1 2 3 4
# app/config/config.yml
cmf_core:
persistence:
phpcr: ~
Persisting Documents in Different Languages
Refer to the PHPCR-ODM documentation for details on persisting documents in different languages.
Choosing a Global Translation Strategy
PHPCR-ODM supports multiple different strategies for persisting translations in the repository. When combining Bundles its possible that one ends up with a mix of different strategies which can make providing a generic search across this data more complicated and might also be less efficient depending on the number of different languages used in the system.
For this purpose the CoreBundle provides a Doctrine listener that can optionally enforce a single translation strategy for all documents:
1 2 3 4 5
# app/config/config.yml
cmf_core:
persistence:
phpcr:
translation_strategy: attribute
Caution
Changing this setting when data was already persisted with a different translation strategy will require manually updating the current data to match that of the chosen translation strategy.
See the PHPCR-ODM documentation for more information.