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


PHP ColumnMap::isTemporal方法代码示例

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


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

示例1: bindValue

 /**
  * @see        DBAdapter::bindValue()
  */
 public function bindValue(PDOStatement $stmt, $parameter, $value, ColumnMap $cMap)
 {
     if ($cMap->isTemporal()) {
         $value = $this->formatTemporalValue($value, $cMap);
     } elseif (is_resource($value) && $cMap->isLob()) {
         // we always need to make sure that the stream is rewound, otherwise nothing will
         // get written to database.
         rewind($value);
         // pdo_sqlsrv must have bind binaries using bindParam so that the PDO::SQLSRV_ENCODING_BINARY
         // driver option can be utilized. This requires a unique blob parameter because the bindParam
         // value is passed by reference and if we didn't do this then the referenced parameter value
         // would change on the next loop
         $blob = "blob" . $position;
         ${$blob} = $value;
         return $stmt->bindParam($parameter, ${$blob}, PDO::PARAM_LOB, 0, PDO::SQLSRV_ENCODING_BINARY);
     }
     return $stmt->bindValue($parameter, $value, $cMap->getPdoType());
 }
开发者ID:rubensayshi,项目名称:propelsandbox,代码行数:21,代码来源:DBSQLSRV.php

示例2: bindValue

 /**
  * Binds a value to a positioned parameted in a statement,
  * given a ColumnMap object to infer the binding type.
  * Warning: duplicates logic from DefaultPlatform::getColumnBindingPHP().
  * Any code modification here must be ported there.
  *
  * @param     PDOStatement  $stmt  The statement to bind
  * @param     string        $parameter  Parameter identifier
  * @param     mixed         $value  The value to bind
  * @param     ColumnMap     $cMap  The ColumnMap of the column to bind
  * @param     null|integer  $position  The position of the parameter to bind
  *
  * @return    boolean
  */
 public function bindValue(PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null)
 {
     if ($cMap->isTemporal()) {
         $value = $this->formatTemporalValue($value, $cMap);
     } elseif (is_resource($value) && $cMap->isLob()) {
         // we always need to make sure that the stream is rewound, otherwise nothing will
         // get written to database.
         rewind($value);
     }
     return $stmt->bindValue($parameter, $value, $cMap->getPdoType());
 }
开发者ID:shelsonjava,项目名称:datawrapper,代码行数:25,代码来源:DBAdapter.php

示例3: bindValue

 /**
  * @see       DBAdapter::bindValue()
  *
  * @param PDOStatement $stmt
  * @param string       $parameter
  * @param mixed        $value
  * @param ColumnMap    $cMap
  * @param null|integer $position
  *
  * @return boolean
  */
 public function bindValue(PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null)
 {
     $pdoType = $cMap->getPdoType();
     // FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL
     // See http://pecl.php.net/bugs/bug.php?id=9919
     if ($pdoType == PDO::PARAM_BOOL) {
         $value = (int) $value;
         $pdoType = PDO::PARAM_INT;
         return $stmt->bindValue($parameter, $value, $pdoType);
     } elseif ($cMap->isTemporal()) {
         $value = $this->formatTemporalValue($value, $cMap);
     } elseif (is_resource($value) && $cMap->isLob()) {
         // we always need to make sure that the stream is rewound, otherwise nothing will
         // get written to database.
         rewind($value);
     }
     return $stmt->bindValue($parameter, $value, $pdoType);
 }
开发者ID:keneanung,项目名称:gw2spidy,代码行数:29,代码来源:DBMySQL.php


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