Skip to content

Conversation

@kenjis
Copy link
Member

@kenjis kenjis commented Aug 30, 2022

Description
From https://forum.codeigniter.com/showthread.php?tid=82814

  • add note to Model Validation
  • some tweaks

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Aug 30, 2022
@kenjis
Copy link
Member Author

kenjis commented Sep 2, 2022

Please review this. This adds a note about the current behavior of in-model validation.

@tomatlscomm
Copy link

Hi.

Only the functions :
Model->validate
Model->update
Model->save (in the update process)

will ignore required unseted fields.

The functions :
Model->insert
Model->save (in the insert process)

will raise errors if required fields are unseted

The cleanRules() method controls whether to remove validation rules or not.
@kenjis
Copy link
Member Author

kenjis commented Sep 2, 2022

@tomatlscomm Thank you!
I didn't read the code carefully.
I've checked, and update the docs.

@kenjis kenjis merged commit dbd1bac into codeigniter4:develop Sep 4, 2022
@kenjis kenjis deleted the fix-docs-model-validation branch September 4, 2022 08:29
@kenjis
Copy link
Member Author

kenjis commented Sep 4, 2022

@paulbalandan Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests for documentation only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants