当前位置: 首页>>代码示例>>PHP>>正文


PHP Adapter::__construct方法代码示例

本文整理汇总了PHP中Zend\Db\Adapter\Adapter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Adapter::__construct方法的具体用法?PHP Adapter::__construct怎么用?PHP Adapter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Db\Adapter\Adapter的用法示例。


在下文中一共展示了Adapter::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 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
     }
 }
开发者ID:mast3rpee,项目名称:blw,代码行数:28,代码来源:PDO.php

示例2: __construct

 /**
  * 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());
         }
     }
 }
开发者ID:mast3rpee,项目名称:blw,代码行数:33,代码来源:MySQLi.php

示例3: __construct

 /**
  * @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);
 }
开发者ID:NguyenQuiDuong,项目名称:Funix,代码行数:11,代码来源:MasterSlaveAdapter.php

示例4: __construct

 public function __construct($driver)
 {
     parent::__construct($driver);
 }
开发者ID:yuwenyu,项目名称:SoJo,代码行数:4,代码来源:AdapterSojo.php

示例5: __construct

 /**
  * Connection constructor.
  * @param array $config
  */
 public function __construct(array $config)
 {
     $this->config = $config;
     parent::__construct($config);
 }
开发者ID:YounessTayer,项目名称:directus,代码行数:9,代码来源:Connection.php


注:本文中的Zend\Db\Adapter\Adapter::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。