diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php index 3b4c4cf9..9c1d8a1d 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php | |||
@@ -2,10 +2,10 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Event\Subscriber; | 3 | namespace Wallabag\CoreBundle\Event\Subscriber; |
4 | 4 | ||
5 | use Doctrine\Bundle\DoctrineBundle\Registry; | ||
5 | use Doctrine\Common\EventSubscriber; | 6 | use Doctrine\Common\EventSubscriber; |
6 | use Doctrine\ORM\Event\LifecycleEventArgs; | 7 | use Doctrine\ORM\Event\LifecycleEventArgs; |
7 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
8 | use Doctrine\Bundle\DoctrineBundle\Registry; | ||
9 | 9 | ||
10 | /** | 10 | /** |
11 | * SQLite doesn't care about cascading remove, so we need to manually remove associated stuf for an Entry. | 11 | * SQLite doesn't care about cascading remove, so we need to manually remove associated stuf for an Entry. |
@@ -45,9 +45,8 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber | |||
45 | public function preRemove(LifecycleEventArgs $args) | 45 | public function preRemove(LifecycleEventArgs $args) |
46 | { | 46 | { |
47 | $entity = $args->getEntity(); | 47 | $entity = $args->getEntity(); |
48 | 48 | if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform | |
49 | if (!$this->doctrine->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver || | 49 | || !$entity instanceof Entry) { |
50 | !$entity instanceof Entry) { | ||
51 | return; | 50 | return; |
52 | } | 51 | } |
53 | 52 | ||