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.
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 ORMClassMetadata
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.