Annotations
3 years ago
EntityTraits
2 years ago
EventListeners
2 years ago
Types
3 years ago
Validator
3 years ago
ArrayCache.php
3 years ago
CacheOnlyMappingDriver.php
3 years ago
ConfigurationFactory.php
3 years ago
ConnectionFactory.php
3 years ago
EntityManagerFactory.php
2 years ago
MetadataCache.php
2 years ago
PSRArrayCache.php
3 years ago
PSRCacheInvalidArgumentException.php
3 years ago
PSRCacheItem.php
3 years ago
PSRMetadataCache.php
3 years ago
ProxyClassNameResolver.php
3 years ago
Repository.php
2 years ago
SerializableConnection.php
3 years ago
TablePrefixMetadataFactory.php
2 years ago
index.php
3 years ago
SerializableConnection.php
40 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Doctrine; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoetVendor\Doctrine\Common\EventManager; |
| 9 | use MailPoetVendor\Doctrine\DBAL\Configuration; |
| 10 | use MailPoetVendor\Doctrine\DBAL\Connection; |
| 11 | use MailPoetVendor\Doctrine\DBAL\Driver; |
| 12 | |
| 13 | class SerializableConnection extends Connection { |
| 14 | private $params; |
| 15 | private $driver; |
| 16 | private $config; |
| 17 | private $eventManager; |
| 18 | |
| 19 | public function __construct( |
| 20 | array $params, |
| 21 | Driver $driver, |
| 22 | Configuration $config = null, |
| 23 | EventManager $eventManager = null |
| 24 | ) { |
| 25 | $this->params = $params; |
| 26 | $this->driver = $driver; |
| 27 | $this->config = $config; |
| 28 | $this->eventManager = $eventManager; |
| 29 | parent::__construct($params, $driver, $config, $eventManager); |
| 30 | } |
| 31 | |
| 32 | public function __sleep() { |
| 33 | return ['params', 'driver', 'config', 'eventManager']; |
| 34 | } |
| 35 | |
| 36 | public function __wakeup() { |
| 37 | parent::__construct($this->params, $this->driver, $this->config, $this->eventManager); |
| 38 | } |
| 39 | } |
| 40 |