You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
The text was updated successfully, but these errors were encountered:
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
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
returnsnull
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)
The text was updated successfully, but these errors were encountered: