Giter VIP home page Giter VIP logo

Comments (6)

ostrolucky avatar ostrolucky commented on August 18, 2024

We cannot just remove those class imports from codebase to preserve compatibility with older Symfony versions. However, there is a compatibility layer which switches between new and old classes. So what particular issue are you running into?

from doctrinebundle.

DjLeChuck avatar DjLeChuck commented on August 18, 2024

Our project is using symfony/doctrine-bridge v7.0.0 and doctrine/doctrine-bundle 2.11.1.

Adding calls to ResolveTargetEntityListener::addResolveTargetEntity using a CompilerPass doesn’t work anymore: no error, it’s just never called.

$resolveTargetEntityListener = $container->findDefinition('doctrine.orm.listeners.resolve_target_entity');
$interface = 'App\My\EntityInterface';
$entity = 'App\My\Entity';
$resolveTargetEntityListener->addMethodCall('addResolveTargetEntity', [$interface, $entity, []]);

Switching back to symfony/doctrine-bridge v6.3.2 and doctrine/doctrine-bundle 2.10.2: all is working as expected.


What’s the compatibility layer you refer to?

from doctrinebundle.

DjLeChuck avatar DjLeChuck commented on August 18, 2024

To be clear: I’m not suggesting to remove any class, I’m suggesting to correct declaration of the three services in order to use the Listerner and not the Subscriber (which doesn’t exists anymore in symfony/doctrine-bridge 7.0) 😄

from doctrinebundle.

ostrolucky avatar ostrolucky commented on August 18, 2024

We are using listener instead of subscriber in case subscribers are not available, BC layer for that can be seen eg. at

$container->removeDefinition('doctrine.orm.listeners.doctrine_dbal_cache_adapter_schema_' . (class_exists(DoctrineDbalCacheAdapterSchemaListener::class) ? 'subscriber' : 'listener'));
// available in Symfony 6.3
$container->removeDefinition('doctrine.orm.listeners.doctrine_token_provider_schema_' . (class_exists(RememberMeTokenProviderDoctrineSchemaListener::class) ? 'subscriber' : 'listener'));

Not sure why it doesn't work in your case. If you can dig deeper into it, that would be appreciated.

from doctrinebundle.

DjLeChuck avatar DjLeChuck commented on August 18, 2024

Yes, I’m on it! I’ve seen the Extension after posting my message.

Will get back soon I hope. :)

from doctrinebundle.

DjLeChuck avatar DjLeChuck commented on August 18, 2024

So... It was a missing tag on our side on the doctrine.orm.listeners.resolve_target_entity.

Sorry for the noise, I’m closing this non-issue!

from doctrinebundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.