I will take your “example/customers” view and “Example.php” controller (customers table) as example and add the following lines:
use Laminas\Db\Sql\Where;
public function customers()
{
...
$where = new Where();
$where->notLike('country', '%USA%');
$crud->where($where);
$output = $crud->render();
return $this->_example_output($output);
}
The code/addition is functioning correctly as expected. However, a problem has arisen, as the quick search filters, as well as the Filter button, are currently non-functional and do not produce any effect.
I’ve fixed the issue for the next version but since the next version will be delayed (e.g. it will probably be released mid August) I am sending you the change that you will need to do:
diff --git a/src/GroceryCrud/Core/Model.php b/src/GroceryCrud/Core/Model.php
index 56926cb..7741251 100755
--- a/src/GroceryCrud/Core/Model.php
+++ b/src/GroceryCrud/Core/Model.php
@@ -1058,7 +1058,7 @@ ORDER BY KU.TABLE_NAME, KU.ORDINAL_POSITION;");
}
if ($this->_where !== null) {
- $select->where($this->_where);
+ $select->where([$this->_where]);
}
return $select;
If you are using composer then go to: vendor/grocery-crud/enterprise/src/GroceryCrud/Core/Model.php and change this line at line 1058. And also for your zip file, unzip the composer package change the code to src/GroceryCrud/Core/Model.php and then zip it again with the filename: grocery-crud-enterprise-3.0.9.zip
Sorry for the extra steps. If you can wait till mid August for the next release even better