當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。