diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index 1b4b1f8c..91620330 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -8,8 +8,7 @@ This bundle adds a locale switcher block in your edit forms. **Currently supported :** * **ORM** : integrates Doctrine ORM entities with Gedmo extensions - -`Currently working on PHPCR integration` +* **PHPCR**: integrates Doctrine PHPCR ODM Reference Guide --------------- @@ -19,4 +18,5 @@ Reference Guide :numbered: reference/installation - reference/orm \ No newline at end of file + reference/orm + reference/phpcr diff --git a/Resources/doc/reference/phpcr.rst b/Resources/doc/reference/phpcr.rst new file mode 100644 index 00000000..67f52a0c --- /dev/null +++ b/Resources/doc/reference/phpcr.rst @@ -0,0 +1,30 @@ +Translate PHPCR models +====================== + + +Doctrine PHPCR ODM handles translations natively so you don't need to install anything else. + + +1. Models +--------- + +First step is to defined which fields you want to translate. + +Please refer to the `Doctrine PHPCR ODM documentation `_ + +Then your model should just implement `Sonata\TranslationBundle\Model\Phpcr\TranslatableInterface`. +This can be done easily by using `Sonata\TranslationBundle\Traits\Translatable`. + +2. Configuration +---------------- + +If you already followed Installation Step 3, you just have to pay attention to PHPCR fallback configuration. + +So if you configured SonataTranslation like this : + +.. code-block:: yaml + + sonata_translation: + locales: [fr, en, it, nl, es] + +Then you should configure `doctrine_phpcr.odm.locales` for the same list.