|
| __construct (ServiceLocatorInterface $serviceLocator) |
|
| create (array $connectionConfig) |
|
Connection adapter factory
@SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 16 of file ConnectionFactory.php.
◆ __construct()
__construct |
( |
ServiceLocatorInterface |
$serviceLocator | ) |
|
Constructor
- Parameters
-
ServiceLocatorInterface | $serviceLocator | |
Definition at line 28 of file ConnectionFactory.php.
30 $this->serviceLocator = $serviceLocator;
◆ create()
create |
( |
array |
$connectionConfig | ) |
|
{Create connection adapter instance
- Parameters
-
- Returns
- \Magento\Framework\DB\Adapter\AdapterInterface
- Exceptions
-
}
Implements ConnectionFactoryInterface.
Definition at line 36 of file ConnectionFactory.php.
38 $quote = new \Magento\Framework\DB\Platform\Quote();
39 $selectFactory = new \Magento\Framework\DB\SelectFactory(
40 new \
Magento\Framework\DB\Select\SelectRenderer(
43 'renderer' =>
new \
Magento\Framework\DB\Select\DistinctRenderer(),
48 'renderer' =>
new \
Magento\Framework\DB\Select\ColumnsRenderer(
$quote),
53 'renderer' =>
new \
Magento\Framework\DB\Select\UnionRenderer(),
58 'renderer' =>
new \
Magento\Framework\DB\Select\FromRenderer(
$quote),
63 'renderer' =>
new \
Magento\Framework\DB\Select\WhereRenderer(),
68 'renderer' =>
new \
Magento\Framework\DB\Select\GroupRenderer(
$quote),
73 'renderer' =>
new \
Magento\Framework\DB\Select\HavingRenderer(),
78 'renderer' =>
new \
Magento\Framework\DB\Select\OrderRenderer(
$quote),
83 'renderer' =>
new \
Magento\Framework\DB\Select\LimitRenderer(),
85 'part' =>
'limitcount' 88 'renderer' =>
new \
Magento\Framework\DB\Select\ForUpdateRenderer(),
95 $objectManagerProvider = $this->serviceLocator->get(\
Magento\Setup\Model\ObjectManagerProvider::class);
96 $mysqlFactory = new \Magento\Framework\DB\Adapter\Pdo\MysqlFactory($objectManagerProvider->get());
97 $resourceInstance =
new Mysql($connectionConfig, $mysqlFactory);
98 return $resourceInstance->getConnection(
99 $this->serviceLocator->get(\
Magento\Framework\DB\Logger\Quiet::class),
The documentation for this class was generated from the following file: