analogueorm / analogue

Analogue ORM : Data Mapper ORM for Laravel/PHP
MIT License
634 stars 51 forks source link

SoftDeletes not working #268

Closed defektrain closed 6 years ago

defektrain commented 6 years ago

Hello, Laravel 5.6 and Analogue 5.6.8 and PostgreSQL.

I have an issue with using softDeletes, for example:

class User extends Entity 
{ 
}
class UserMap extends EntityMap
{
    public $softDeletes = true;
} 

And a table in DB with fields id, login and deleted_at (timestamp).

When I try to delete:

$mapper = mapper(User::class);
$user = $mapper->find($id);
$mapper->delete($user);

I get next error:

Analogue \ ORM \ Exceptions \ EntityMapNotFoundException
No Map registered for Analogue\ORM\Events\Deleting

…/vendor/analogue/orm/src/System/Manager.php459

Can you help me with that? Thanks.

RemiCollin commented 6 years ago

Thank you for reporting it; i just released a patch that should fix it; can you run composer update and confirm it works for you ?

defektrain commented 6 years ago

Yes, now it's working, thank you.