-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Smile\GdprDump\Database; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Smile\GdprDump\Database\Driver\DriverInterface; | ||
use Smile\GdprDump\Database\Metadata\MetadataInterface; | ||
|
||
/** | ||
* Wrapper that stores the following objects: | ||
* - connection: the Doctrine connection. | ||
* - driver: allows to retrieve the DSN that was used to connect to the database. | ||
* - metadata: allows to fetch the database metadata (table names, foreign key constraints). | ||
* | ||
* We use a custom abstraction layer for database metadata, because the Doctrine schema manager | ||
* crashes when used with databases that use custom Doctrine types (e.g. OroCommerce). | ||
*/ | ||
interface DatabaseInterface | ||
{ | ||
public const DRIVER_MYSQL = 'pdo_mysql'; | ||
|
||
/** | ||
* Get the doctrine connection. | ||
*/ | ||
public function getConnection(): Connection; | ||
|
||
/** | ||
* Get the database driver. | ||
*/ | ||
public function getDriver(): DriverInterface; | ||
|
||
/** | ||
* Get the database metadata. | ||
*/ | ||
public function getMetadata(): MetadataInterface; | ||
|
||
/** | ||
* Get the connection parameters (host, port, user...). | ||
*/ | ||
public function getConnectionParams(): ParameterBag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters