- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
array_walk($additional_constraints_arr, create_function('&$field_value, $field_dest', '$field_value = (substr($field_dest, -1) == "!" ? "' .
$table . '.' . ($prepend_table_name ? make_singular($table) . '_' : '') . '" .
substr($field_dest, 0, -1) . " != " . "\"" . $field_value . "\"" : (substr($field_dest, -1) == "%" ? "LOWER(" . "' .
$table . '.' . ($prepend_table_name ? make_singular($table) . '_' : '') . '" .
substr($field_dest, 0, -1) . ") LIKE " . "LOWER(\"%" . $field_value . "%\")" : (substr($field_dest, -1) == "~" ? "' .
$table . '.' . ($prepend_table_name ? make_singular($table) . '_' : '') . '" .
substr($field_dest, 0, -1) . " = " . $field_value : "' .
$table . '.' . ($prepend_table_name ? make_singular($table) . '_' : '') . '" . ' .
'$field_dest . " = " . "\"" . $field_value . "\"")));'));
... just a simple 'WHERE' clause expanded to Godzilla-size ...
denis 10.09.2009 16:16 # 0
Suor 14.09.2009 12:46 # 0
ни к чему использовать create_function, PHP вообще к таким конструкциям, это епархия перла