本文整理汇总了PHP中CDbConnection::quoteValue方法的典型用法代码示例。如果您正苦于以下问题:PHP CDbConnection::quoteValue方法的具体用法?PHP CDbConnection::quoteValue怎么用?PHP CDbConnection::quoteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDbConnection
的用法示例。
在下文中一共展示了CDbConnection::quoteValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: secureOutput
/**
* Generates a string which is suitable for output into an sql query from
* any data that may be outputable. This method protects strings against
*
* @param CDbConnection $connection
* @param mixed $columnInsertValue
* @return string
*/
public function secureOutput(CDbConnection $connection, $columnInsertValue)
{
if ($columnInsertValue === null) {
return 'NULL';
}
return $connection->quoteValue($columnInsertValue);
}
示例2: _treeLimits
/**
* gets the list of left and right boundaries for any given owner objects.
*
* @param CDbConnection $db
* @param string $tree_table
* @param string $obj_id
*
* @returns array of array(left, right)
*/
protected function _treeLimits($db, $tree_table, $obj_id)
{
$query = 'SELECT ' . $this->leftAttribute . ',' . $this->rightAttribute . ' FROM ' . $tree_table . ' WHERE ' . $this->idAttribute . ' = ' . $db->quoteValue($obj_id);
$res = $db->createCommand($query)->query();
$result = array();
foreach ($res as $r) {
$result[] = array($r[$this->leftAttribute], $r[$this->rightAttribute]);
}
return $result;
}
示例3: escape
public function escape($string)
{
$this->db->quoteValue($string);
}