/** * Constructor * * @throws \BLW\Model\InvalidArgumentException If an invalid argument is passed. * * @param \PDO $Connection * PDO Object already connected to DB. * @param \Zend\Db\Adapter\Platform\PlatformInterface $platform * [optional] Adaptor Platform (Mysql, Oracle, Postgre, Sqlite, etc). * @param \Zend\Db\ResultSet\ResultSetInterface $queryResultPrototype * [optional] Result set class. <code>NULL</code> for default. * @param \Zend\Db\Adapter\Profiler\ProfilerInterface $profiler * [optional] Adapter profiler. */ public function __construct(\PDO $Connection, PlatformInterface $platform = null, ResultSetInterface $queryResultPrototype = null, ProfilerInterface $profiler = null) { // Creat driver $Driver = new Driver(new Connection($Connection)); // Call parent try { parent::__construct($Driver, $platform, $queryResultPrototype, $profiler); // Forward exception } catch (\Zend\Db\Exception\InvalidArgumentException $e) { // @codeCoverageIngoreStart throw new InvalidArgumentException(-1, '%header% ' . $e->getMessage(), $e->getCode()); // @codeCoverageIngoreEnd } }
/** * Constructor * * @throws \BLW\Model\InvalidArgumentException If an invalid argument is passed. * * @param resource $Connection * PDO Object already connected to DB. * @param \Zend\Db\Adapter\Platform\PlatformInterface $platform * [optional] Adaptor Platform (Mysql, Oracle, Postgre, Sqlite, etc). * @param \Zend\Db\ResultSet\ResultSetInterface $queryResultPrototype * [optional] Result set class. <code>NULL</code> for default. * @param \Zend\Db\Adapter\Profiler\ProfilerInterface $profiler * [optional] Adapter profiler. */ public function __construct($Connection, PlatformInterface $platform = null, ResultSetInterface $queryResultPrototype = null, ProfilerInterface $profiler = null) { // Check connection if (!is_resource($Connection) ?: strpos(get_resource_type($Connection), 'mysql') === false) { // Exception throw new InvalidArgumentException(0, '%header% Argument 1 should be a myqli connection'); } else { // Create driver $Driver = new Driver(new Connection($Connection)); // Call parent try { parent::__construct($Driver, $platform, $queryResultPrototype, $profiler); // Invalid argument? } catch (\Zend\Db\Exception\InvalidArgumentException $e) { // Forward exception throw new InvalidArgumentException(-1, '%header% ' . $e->getMessage(), $e->getCode()); } } }
/** * @param Adapter $slaveAdapter * @param Driver\DriverInterface|array $driver * @param Platform\PlatformInterface $platform * @param ResultSet\ResultSet $queryResultPrototype */ public function __construct(Adapter $slaveAdapter, $driver, Platform\PlatformInterface $platform = null, ResultSet\ResultSetInterface $queryResultPrototype = null) { $this->slaveAdapter = $slaveAdapter; parent::__construct($driver, $platform, $queryResultPrototype); }
public function __construct($driver, Platform\PlatformInterface $platform = null, ResultSet\ResultSetInterface $queryResultPrototype = null, Profiler\ProfilerInterface $profiler = null, Filesystem $filesystem = null) { $this->_filesystem = $filesystem; parent::__construct($driver, $platform, $queryResultPrototype, $profiler); }
public function __construct($driver) { parent::__construct($driver); }
/** * Connection constructor. * @param array $config */ public function __construct(array $config) { $this->config = $config; parent::__construct($config); }