cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

fixed getRelated already fetched relations

Open rudiservo opened this issue 2 years ago • 0 comments

Hello!

  • Type: bug fix | new feature | code quality
  • Link to issue: #16409

In raising this pull request, I confirm the following:

  • [X] I have read and understood the Contributing Guidelines
  • [X] I have checked that another pull request for this purpose does not exist
  • [ ] I wrote some tests for this PR
  • [ ] I have updated the relevant CHANGELOG
  • [ ] I have created a PR for the documentation about this change

Small description of change: GetRelated should reuse already fetched relation inside the model, avoiding more hits to the database. If devs need fresh data they can use Model::refresh and with the PR also ResultSet::refresh.

Thanks

rudiservo avatar Oct 02 '23 11:10 rudiservo