add Doctrine Connection bridge
This commit is contained in:
parent
c71f2daea4
commit
76bd005b45
42
Doctrine/DBAL/ConnectionBridge.php
Normal file
42
Doctrine/DBAL/ConnectionBridge.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\OxidServiceBridges\Doctrine\DBAL;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
|
||||
class ConnectionBridge implements ConnectionBridgeInterface
|
||||
{
|
||||
/**
|
||||
* @var Connection
|
||||
*/
|
||||
private $connection;
|
||||
|
||||
public function __construct(
|
||||
Connection $connection
|
||||
) {
|
||||
$this->connection = $connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $moduleId
|
||||
* @param int $shopId
|
||||
* @return Connection
|
||||
*/
|
||||
public function getConnection(): Connection
|
||||
{
|
||||
return $this->connection;
|
||||
}
|
||||
}
|
28
Doctrine/DBAL/ConnectionBridgeInterface.php
Normal file
28
Doctrine/DBAL/ConnectionBridgeInterface.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\OxidServiceBridges\Doctrine\DBAL;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
|
||||
interface ConnectionBridgeInterface
|
||||
{
|
||||
/**
|
||||
* @param string $moduleId
|
||||
* @param int $shopId
|
||||
* @return string
|
||||
*/
|
||||
public function getConnection(): Connection;
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
public: false
|
||||
public: true
|
||||
|
||||
D3\OxidServiceBridges\Doctrine\DBAL\ConnectionBridgeInterface:
|
||||
class: D3\OxidServiceBridges\Doctrine\DBAL\ConnectionBridge
|
||||
|
||||
D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridgeInterface:
|
||||
class: D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridge
|
||||
public: true
|
||||
|
Loading…
Reference in New Issue
Block a user