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


PHP Zend_Db_Select::getBind方法代码示例

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


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

示例1: query

 /**
  * Special handling for PDO query().
  * All bind parameter names must begin with ':'
  *
  * @param string|Zend_Db_Select $sql The SQL statement with placeholders.
  * @param array $bind An array of data to bind to the placeholders.
  * @return Zend_Db_Statement_Pdo
  * @throws Zend_Db_Adapter_Exception To re-throw PDOException.
  */
 public function query($sql, $bind = array())
 {
     if (empty($bind) && $sql instanceof Zend_Db_Select) {
         $bind = $sql->getBind();
     }
     if (!empty($bind)) {
         foreach ($bind as $name => $value) {
             if ($value instanceof Zend_Date) {
                 $bind[$name] = $value->toString('yyyy-MM-dd HH:mm:ss');
             }
         }
     }
     return parent::query($sql, $bind);
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:23,代码来源:Mysql.php

示例2: query

 /**
  * Special handling for PDO query().
  * All bind parameter names must begin with ':'
  *
  * @param string|Zend_Db_Select $sql The SQL statement with placeholders.
  * @param array $bind An array of data to bind to the placeholders.
  * @return Zend_Db_Statement_Pdo
  * @throws Zend_Db_Adapter_Exception To re-throw PDOException.
  */
 public function query($sql, $bind = array())
 {
     if (empty($bind) && $sql instanceof Zend_Db_Select) {
         $bind = $sql->getBind();
     }
     if (is_array($bind)) {
         foreach ($bind as $name => $value) {
             if (!is_int($name) && !preg_match('/^:/', $name)) {
                 $newName = ":{$name}";
                 unset($bind[$name]);
                 $bind[$newName] = $value;
             }
         }
     }
     try {
         return parent::query($sql, $bind);
     } catch (PDOException $e) {
         /**
          * @see Zend_Db_Statement_Exception
          */
         require_once 'Zend/Db/Statement/Exception.php';
         throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:null-1,项目名称:fangtaitong,代码行数:33,代码来源:Abstract.php

示例3: query

 /**
  * Special handling for PDO query().
  * All bind parameter names must begin with ':'
  *
  * @param string|Zend_Db_Select $sql The SQL statement with placeholders.
  * @param array $bind An array of data to bind to the placeholders.
  * @return Zend_Db_Statement_Pdo
  * @throws Zend_Db_Adapter_Exception To re-throw PDOException.
  */
 public function query($sql, $bind = array())
 {
     if (empty($bind) && $sql instanceof Zend_Db_Select) {
         $bind = $sql->getBind();
     }
     if (is_array($bind)) {
         foreach ($bind as $name => $value) {
             if (!is_int($name) && !preg_match('/^:/', $name)) {
                 $newName = ":{$name}";
                 unset($bind[$name]);
                 $bind[$newName] = $value;
             }
         }
     }
     // Bubble_Debug start
     $start = microtime(true);
     $result = parent::query($sql, $bind);
     if (class_exists('Mage')) {
         Mage::dispatchEvent('bubble_debug_sql_query_before', array('adapter' => $this, 'query' => $sql, 'bind' => $bind, 'took' => microtime(true) - $start));
     }
     return $result;
     // Bubble_Debug end
     try {
         return parent::query($sql, $bind);
     } catch (PDOException $e) {
         /**
          * @see Zend_Db_Statement_Exception
          */
         #require_once 'Zend/Db/Statement/Exception.php';
         throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:cvalcke,项目名称:magento-debug,代码行数:41,代码来源:Abstract.php


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