easily disable gedmo softdeletable


August 05, 2016 at 10:11
Symfony

Gedmo softdeletable is a nice aid to not fully delete database entries, but set deletedAt. I used this for a Symfony2 project, but unfortunately in once instance I needed to temporarily disable this feature. There seems to be a nice little trick:

$em->setDeletedAt(new \DateTime());
$em->remove($item);
$em->flush();

Found it here


Tags: gedmo softdeletable Symfony2


Hinterlasse einen Kommentar:
Search