forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for more complex conditions for update(),delete()
Replacement for codeigniter4#1441 and codeigniter4#1325 + improvements (outer function for parsing id, and better condition checking). Allows to pass more complex data for update and delete methods. Before delete and update supports only numeric $id. and produces: WHERE primaryKey IN(1); or WHERE primaryKey IN(2,3,4) - for arrays. I've added support for: - non empty string -> WHERE table.primaryKey = 'value' `$id = 'value'` (it was wired it doesn't support it and we are thinking about production version of ci4) - associative arrays -> WHERE table.field = 'value' `$id =['field' => 'value']` - more complex associative arrays -> WHERE table.field = 'value' AND table.fieldin IN(2,3,4) `$id =['field' => 'value', 'fieldin' => [2,3,4]]`
- Loading branch information
1 parent
0fba13c
commit 4dddb4a
Showing
1 changed file
with
56 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters