Skip to content

make findTranslation consistent to find #557

@dbu

Description

@dbu

As discussed here https://github.com/doctrine/phpcr-odm/pull/555/files#r17139257 the findTranslation resets translated fields to the stored fields unless you are switching to another locale that before was snapshoted with bindTranslation. It would be more consistent to always do the same as find, which is to return the current state of the object. Not specifying a locale would make no sense, and specifying the locale that the document already is in would be no real operation.

To reset translated fields, DocumentManager::refresh should be used to reset the whole document to database state.

this is a BC break for code that relied on this inconsistent behaviour, but i think its better to fix this than to keep being inconsistent.

see also #556 for more discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions