Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypedFieldMapper for automatic mapping of typed PHP fields to DBA…
…L types (doctrine#10313) Previously, only a predefined set of automatic mappings was allowed, such as int, float, boolean, DateTime etc. With this extension, it is possible to supply custom TypedFieldMapper implementation which takes as parameter the ReflectionProperty of a given field and decides the appropriate mapping. A new configuration option was added to set and get the TypedFieldMapper. The old logic was moved into a class DefaultTypedFieldMapper which is used by default when no mapper is supplied. The selected TypedFieldMapper is passed into ClassMetadataInfo constructor. If empty, the DefaultTypedFieldMapper is used. There is also ChainTypedFieldMapper class which allows chaining multiple TypedFieldMappers and apply them in a cascade (always if a field gets type assigned by the earlier mapper in the list, it will not be changed later).
- Loading branch information