You can always use the where method but as a string. So for example let’s say that you would like to have the following where in:
WHERE country IN('US','GR')
you can do that by using the string element of where but you will need to make sure that you start and finish with a parenthesis. For example:
$countries = ['US', 'GR'];
if (!empty($countries)) {
// Don't forget to add a parenthesis to the string
// or else the filtering and quick search will not work
$crud->where("(country IN('" . implode("','", $countries) ."'))");
}
and of course you can create your own helper for that, for example something like this:
function groceryCrudWhereIn($fieldName, $in = array()) {
if (empty($in)) {
// we have to return something valid for where.
// If your array is empty and you would like to have
// the opposite behavior you can change this
// to (1 = 0)
return '(1 = 1)';
}
return "(`$fieldName` IN('" . implode("','", $in) ."'))";
}
// Example of usage:
$countries = ['US', 'GR'];
$crud->where(groceryCrudWhereIn('country' , $countries));