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


PHP PropelPDO::log方法代码示例

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


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

示例1: bindParam

 /**
  * Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement
  * that was use to prepare the statement. Unlike PDOStatement::bindValue(), the variable is bound
  * as a reference and will only be evaluated at the time that PDOStatement::execute() is called.
  * Returns a boolean value indicating success.
  *
  * @param integer $pos            Parameter identifier (for determining what to replace in the query).
  * @param mixed   $value          The value to bind to the parameter.
  * @param integer $type           Explicit data type for the parameter using the PDO::PARAM_* constants. Defaults to PDO::PARAM_STR.
  * @param integer $length         Length of the data type. To indicate that a parameter is an OUT parameter from a stored procedure, you must explicitly set the length.
  * @param mixed   $driver_options
  *
  * @return boolean
  */
 public function bindParam($pos, &$value, $type = PDO::PARAM_STR, $length = 0, $driver_options = null)
 {
     $debug = $this->pdo->getDebugSnapshot();
     $typestr = isset(self::$typeMap[$type]) ? self::$typeMap[$type] : '(default)';
     $return = parent::bindParam($pos, $value, $type, $length, $driver_options);
     $valuestr = $length > 100 ? '[Large value]' : var_export($value, true);
     $msg = sprintf('Binding %s at position %s w/ PDO type %s', $valuestr, $pos, $typestr);
     $this->boundValues[$pos] = $valuestr;
     $this->pdo->log($msg, null, __METHOD__, $debug);
     return $return;
 }
开发者ID:szabobeni,项目名称:benstore,代码行数:25,代码来源:DebugPDOStatement.php

示例2: bindValue

 /**
  * Binds a value to a corresponding named or question mark placeholder in the SQL statement
  * that was use to prepare the statement.  Returns a boolean value indicating success.
  *
  * @param      int $pos Parameter identifier (for determining what to replace in the query).
  * @param      mixed $value The value to bind to the parameter.
  * @param      int $type Explicit data type for the parameter using the PDO::PARAM_* constants. Defaults to PDO::PARAM_STR.
  * @return     boolean
  */
 public function bindValue($pos, $value, $type = PDO::PARAM_STR)
 {
     $debug = $this->pdo->getDebugSnapshot();
     $typestr = isset(self::$typeMap[$type]) ? self::$typeMap[$type] : '(default)';
     $return = parent::bindValue($pos, $value, $type);
     $valuestr = $type == PDO::PARAM_LOB ? '[LOB value]' : var_export($value, true);
     $msg = "Binding {$valuestr} at position {$pos} w/ PDO type {$typestr}";
     $this->boundValues[$pos] = $valuestr;
     $this->pdo->log($msg, null, __METHOD__, $debug);
     return $return;
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:20,代码来源:DebugPDOStatement.php


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