Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.12 KB

hints-on-result-hydration.md

File metadata and controls

25 lines (20 loc) · 1.12 KB

Hints on result hydration

When using Doctrine as your persistence driver, you may configure FOSElasticaBundle to use query hints when hydrating your objects.

To configure FOSElasticaBundle to use hints when hydrating objects, add an entry to the hints array of elastica_to_model_transformer configuration section. Each entry must contain a name of the hint and a value to use.

fos_elastica:
    indexes:
        user:
            persistence:
                elastica_to_model_transformer:
                    hints:
                        - {name: 'doctrine.customOutputWalker', value: 'Gedmo\Translatable\Query\TreeWalker\TranslationWalker'}

This is especially useful if you're using features that require additional information when hydrating an object (like the translatable behavior from Doctrine2 behavioral extensions) and you don't want Doctrine to issue additional queries to retrieve it.

This option is only available for the ORM driver.