laravel-doctrine icon indicating copy to clipboard operation
laravel-doctrine copied to clipboard

TrashedFilter: Stop get_class call when FQCN is passed

Open acairns opened this issue 10 years ago • 6 comments

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

acairns avatar Feb 14 '15 08:02 acairns

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.

kirkbushell avatar Feb 14 '15 17:02 kirkbushell

Wouldn't $metadata->rootEntityName always be a string?

acairns avatar Feb 14 '15 17:02 acairns

Not sure - but this change breaks the package :) If you can fix that up, we're good to go.

kirkbushell avatar Mar 09 '15 19:03 kirkbushell

@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 avatar Mar 09 '15 20:03 acairns

@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.

kirkbushell avatar Mar 09 '15 20:03 kirkbushell

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.)

sisve avatar Apr 24 '15 07:04 sisve