diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/CoreBundle/Event | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/CoreBundle/Event')
3 files changed, 10 insertions, 11 deletions
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php index 4ebe837b..1dd0a1a4 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php | |||
@@ -2,13 +2,13 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Event\Subscriber; | 3 | namespace Wallabag\CoreBundle\Event\Subscriber; |
4 | 4 | ||
5 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | 5 | use Doctrine\ORM\EntityManager; |
6 | use Psr\Log\LoggerInterface; | 6 | use Psr\Log\LoggerInterface; |
7 | use Wallabag\CoreBundle\Helper\DownloadImages; | 7 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
8 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
9 | use Wallabag\CoreBundle\Event\EntrySavedEvent; | ||
10 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; | 9 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; |
11 | use Doctrine\ORM\EntityManager; | 10 | use Wallabag\CoreBundle\Event\EntrySavedEvent; |
11 | use Wallabag\CoreBundle\Helper\DownloadImages; | ||
12 | 12 | ||
13 | class DownloadImagesSubscriber implements EventSubscriberInterface | 13 | class DownloadImagesSubscriber implements EventSubscriberInterface |
14 | { | 14 | { |
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 | ||
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 711c3bf8..fb8f225f 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php | |||
@@ -39,12 +39,12 @@ class TablePrefixSubscriber implements EventSubscriber | |||
39 | return; | 39 | return; |
40 | } | 40 | } |
41 | 41 | ||
42 | $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]); | 42 | $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); |
43 | 43 | ||
44 | foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { | 44 | foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { |
45 | if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { | 45 | if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { |
46 | $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; | 46 | $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; |
47 | $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix.$mappedTableName; | 47 | $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | } | 50 | } |