Closed rosorrentino closed 9 years ago
Hi @rosorrentino, This is how I solved this particular problem. I created a filter on my model.
static function search($orm, $search = '') {
if(strlen(trim($search) === 0)) {
return $orm;
}
return $orm->where_raw(
'(`email` LIKE ? OR `first_name` LIKE ? OR `last_name` LIKE ?)',
array('%'.$search.'%', '%'.$search.'%', '%'.$search.'%')
);
}
Thanks, I will try that, much appreciate it.
This is the route to do this kind of thing with Idiorm.
HI, I am looking in documentation for a option as where_any_is or where_in but to use as “like” so I can use wildcards in the search values (same as use WHERE x LIKE y OR x LIKE z);
I think this methods “where_any_is" or “where_in" are very useful since we can give arrays and the number of inputs are variable.