1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00

Replace LifecycleEventArgs by PreRemoveEventArgs

This commit is contained in:
Yassine Guedidi 2025-04-02 00:17:54 +02:00
parent c9301bd0b3
commit 402d80cd30

View file

@ -4,7 +4,7 @@ namespace Wallabag\Event\Subscriber;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreRemoveEventArgs;
use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\ManagerRegistry;
use Wallabag\Entity\Entry; use Wallabag\Entity\Entry;
@ -38,7 +38,7 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
* We removed everything related to the upcoming removed entry because SQLite can't handle it on it own. * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own.
* We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone). * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone).
*/ */
public function preRemove(LifecycleEventArgs $args) public function preRemove(PreRemoveEventArgs $args)
{ {
$entity = $args->getObject(); $entity = $args->getObject();
if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform