Skip to content
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

Change after methods to use actual data #2332

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Oct 15, 2019

Description
Currently model events afterInsert and afterUpdate pass on the original data they were called with. This severely limits what event triggers can do, not knowing the data that actually reached the database. This PR triggers events with the inserted/updated data instead. Additionally, afterInsert now passes the ID of the newly-inserted row (similar to other events), or 0 on failure.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@MGatner
Copy link
Member Author

MGatner commented Oct 15, 2019

Fixes #2045

@lonnieezell lonnieezell merged commit 65cc1f4 into codeigniter4:develop Oct 16, 2019
@MGatner MGatner deleted the afterinsert branch October 16, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants