本文整理汇总了PHP中format::value_escape方法的典型用法代码示例。如果您正苦于以下问题:PHP format::value_escape方法的具体用法?PHP format::value_escape怎么用?PHP format::value_escape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::value_escape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: primary_key_expression
/**
* determine SQL clause expression to match for data_row primary keys
*
* @return string
*/
public static function primary_key_expression($db_doc, $node_schema, $node_table, $data_row_columns, $data_row)
{
$primary_keys = format_table::primary_key_columns($node_table);
$primary_key_index = xml_parser::data_row_overlay_primary_key_index($primary_keys, $data_row_columns, $data_row_columns);
$primary_key_index = $primary_key_index['base'];
// figure out the primary key expression
$primary_key_expression = array();
foreach ($primary_keys as $primary_column_name) {
if (!isset($primary_key_index[$primary_column_name])) {
throw new exception("primary key column named {$primary_column_name} not found in primary_key_index");
}
$column_index = $primary_key_index[$primary_column_name];
// get the type of the column, chasing foreign keys if necessary
$node_column = dbx::get_table_column($node_table, $primary_column_name);
$value_type = format_column::column_type($db_doc, $node_schema, $node_table, $node_column, $foreign);
$primary_key_expression[] = format::get_quoted_column_name($primary_column_name) . ' = ' . format::value_escape($value_type, $data_row->col[$column_index]);
}
if (count($primary_key_expression) == 0) {
throw new exception($node_table['name'] . " primary_key_expression is empty, determinate loop failed");
}
return implode(' AND ', $primary_key_expression);
}