/** * Constructor * * @param \Phinx\Db\Adapter\AdapterInterface $adapter The original adapter to decorate. * @param \CoreTyson\Database\Database $connection The connection to actually use. */ public function __construct(AdapterInterface $adapter, Database $connection) { $this->adapter = $adapter; $this->connection = $connection; $pdo = $adapter->getConnection(); $connection->driver()->connection($pdo); }
/** * Gets the database connection * * @return \PDO */ public function getConnection() { return $this->adapter->getConnection(); }