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

Revert Model coalesce #4819

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Revert Model coalesce #4819

merged 1 commit into from
Jun 10, 2021

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Jun 10, 2021

Description
The following change was made to Model::__get() to simplify code with null coalescence: ace9df0#diff-1a690370bdbdc5997068f9ff210bacef314eeb65d1df73af206783ce055d8d1d

However, because of the magic accessors on BaseModel and Connection this did not end up being logically equivalent. Reverting that part of the PR.

Checklist:

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

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. So my hunch before was right that it doesn't sit right.

@MGatner
Copy link
Member Author

MGatner commented Jun 10, 2021

Yep. I'm not actually ever sure what is happening but Model is causing calls to Connection that it never used to. I think we need to leave these things alone, and in version 5 have a rule for "no magic calls/access to classes with magic". It's too messy.

@MGatner MGatner merged commit 2198dd0 into codeigniter4:develop Jun 10, 2021
@MGatner MGatner deleted the magic-model branch June 10, 2021 19:54
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