本文整理匯總了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);
}