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

[BUG] Registry returns manager for unsupported classes if it has one manager #578

Open
Hermaniandr opened this issue Aug 19, 2024 · 0 comments

Comments

@Hermaniandr
Copy link

If there is only one manager, there is no check that it supports entity - it was removed in this PR https://github.com/laravel-doctrine/orm/pull/288/files
As a result, if method called with some random class (e.g. \DateTime) - manager will be returned, even though it doesn't support this class.

Package version, Laravel version

laravel-doctrine/orm: 2.1.0
laravel/framework: 11.9.2

Expected behaviour

LaravelDoctrine\ORM\IlluminateRegistry::getManagerForClass returns null for non-Entities if it has one manager.

Actual behaviour

LaravelDoctrine\ORM\IlluminateRegistry::getManagerForClass returns manager for non-entities if it has one manager.

Steps to reproduce the behaviour

Registry::getManagerForClass(\DateTime::class)

@Hermaniandr Hermaniandr changed the title [BUG] Registry returns manager for inappropriate classes if it has one manager [BUG] Registry returns manager for unsupported classes if it has one manager Aug 19, 2024
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

No branches or pull requests

1 participant