/** * Initialise data for configuration * @return void */ protected function initData() { $data = $this->cache->load($this->cacheId); if (false === $data) { $singleQuery = $this->config->getConnectionName('checkout_setup') == 'default' ? true : false; $data['checkout'] = $singleQuery; $this->cache->save(serialize($data), $this->cacheId, $this->cacheTags); } else { $data = unserialize($data); } $this->merge($data); }
/** * Retrieve connection to resource specified by $resourceName * * @param string $resourceName * @return \Magento\Framework\DB\Adapter\AdapterInterface|false */ public function getConnection($resourceName) { $connectionName = $this->_config->getConnectionName($resourceName); if (isset($this->_connections[$connectionName])) { return $this->_connections[$connectionName]; } $connection = $this->_connectionFactory->create($connectionName); if (!$connection) { return false; } $connection->setCacheAdapter($this->_cache->getFrontend()); $this->_connections[$connectionName] = $connection; return $connection; }
/** * Retrieve connection to resource specified by $resourceName * * @param string $resourceName * @return \Magento\Framework\DB\Adapter\AdapterInterface|false */ public function getConnection($resourceName) { $connectionName = $this->_config->getConnectionName($resourceName); return $this->getConnectionByName($connectionName); }