Skip to content

Feature request: Add support for TypeFieldMapper #1696

@adrianrudnik

Description

@adrianrudnik

Since doctrine/orm#10313 we now have a way to extend the automatic mapping of DBAL types.

Similar to \Doctrine\ORM\Configuration::setNamingStrategy there is now \Doctrine\ORM\Configuration::setTypedFieldMapper, which is not yet configurable by this bundle afaik.

It would be nice to have it configurable with a service, so we can extend it, like we have for the naming_strategy.

My current workaround to get custom types injected is rather cumbersome, and I'm not even sure if my way is to complicated and there is a much easier way to achieve this. I had to circumvent a lot of private service dependencies to get near the configuration stuff, while preserving all injections:

# services.php

$services->set('app.typed_field_mapper', DefaultTypedFieldMapper::class)
    ->args([[CustomField::class => 'customfield']]);

$services->set(Doctrine\ORM\Configuration::class)
    ->public()
    ->decorate('doctrine.orm.default_configuration', 'doctrine.orm.default_configuration.inner')
    ->parent('doctrine.orm.default_configuration')
    ->call('setTypedFieldMapper', [service('app.typed_field_mapper')]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy