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.
update - validation only provided elements
According to codeigniter4#1559 I write some code which allows to filter validationRules to that elements which are provided in $data. ---- Allows to filter validation rules to only that elements which are in $data passed to update method If you'd like to check only fields passed in $data during update just call: $this->update($your_id, $your_data, true); if there is 5 rules in your $validation_rules and only two of them in $your_data array then only that two elements will be checked in validation process if you pass true as a 3rd arg (if you don't provide it or set to false then update will check every rule as is now). Useful: i.e. you want to only update user nickname or password instead of passing all user attributes.
- Loading branch information
1 parent
1680e90
commit 946c9ae
Showing
1 changed file
with
32 additions
and
13 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