Ejemplo n.º 1
0
 /**
  * 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
     }
 }
Ejemplo n.º 2
0
 /**
  * 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());
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * @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);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 public function __construct($driver)
 {
     parent::__construct($driver);
 }
Ejemplo n.º 6
0
 /**
  * Connection constructor.
  * @param array $config
  */
 public function __construct(array $config)
 {
     $this->config = $config;
     parent::__construct($config);
 }