doctrine / doctrine/phpcr-odm

Find solution for explicit localization when using the document manager

Open
#623 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
181
Forks
102
PR merge metrics
No merged PRs in 30d

Description

The document manager currently has one localization aware method - `findTranslation`, which is the localized analogue of `find` There does not exist an analogue for ``findMany` and the query builder does not support localizing results.

Other methods that could be localized:
- `getReferrers`
- `getReference` (?)
- `getChildren`
- `getDocumentsByPhpcrQuery`

Repository classes also have methods which could be localized.

Possible solutions
- Do nothing and deprecate `findTranslation`: The user must change global state by changing the locale of the locale chooser.
- Make the DocumentManager localizable through a `localize` method which returns a localized clone of the DocumentManager.
- Add explicit translated methods: `getTranslatedReferrers`, `findTranslatedMany`
- Add additional, optional, `$locale` argument to all existing localizable methods.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.