本文整理汇总了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());
}
示例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());
}
示例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);
}