Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix that #[Polyglot\Translatable] may be used on unmapped fields #68

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

mpdude
Copy link
Member

@mpdude mpdude commented Apr 24, 2024

It may be useful to use the #[Polyglot\Translatable] attribute (or the corresponding annotation) on properties that are not configured as mapped Doctrine ORM fields. For example, the property value might be set by entity lifecycle callbacks or Doctrine listeners.

It was possible to do so until #28 changed \Webfactory\Bundle\PolyglotBundle\Doctrine\TranslatableClassMetadata::findTranslatedProperties to work based on Doctrine ORM ClassMetadata information and fields. This was done to simplify detection of whether a particular property belongs to a given class or needs to be mapped through base class translations. Obviously, ClassMetadata does not know about unmapped properties.

This PR changes the code to work on PHP reflection data instead, restoring functionality.

@mpdude mpdude changed the title non mapped fields Fix that #[Polyglot\Translatable] may be used on unmapped fields Apr 24, 2024
@mpdude mpdude merged commit 9c3420b into 3.x Apr 25, 2024
@mpdude mpdude deleted the non-mapped-fields branch April 25, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant