Skip to content

docs: update Model validation #6459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 4, 2022

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