laravel-doctrine
laravel-doctrine copied to clipboard
TrashedFilter: Stop get_class call when FQCN is passed
When checking if an entity is soft-deletable, a FQCN is passed - resulting in get_class being called on a string.
Fixes: ErrorException: get_class() expects parameter 1 to be object, string given
This needs an update - it will break when the entity object is passed, so it should cater for both scenarios.
If you could update it to include that, then we can merge it in.
Wouldn't $metadata->rootEntityName always be a string?
Not sure - but this change breaks the package :) If you can fix that up, we're good to go.
@kirkbushell I ran the tests before committing, they were passing locally.
Is the CI hosted somewhere where I can take a look? Also, I'm up-to-date with 0.6 and the build still passes for me locally.
@acairns not sure, tbh I checked this out a couple of weeks ago and it was breaking then - which was the reason for the original comment.
This issue is blocking us from using a non-forked laravel-doctrine. The property ClassMetadata::$rootEntityName is a string according to the documentation. All tests run locally with "OK (11 tests, 17 assertions)", no matter how much I mess up TrashedFilter.php. (I guess it isn't covered at all.)