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

[5.3] Refactoring views to directly call models (frontend) #44170

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Sep 30, 2024

Summary of Changes

This PR refactors the views to get the model object and then directly call the methods of the model instead of going through the View::get() indirection. This refactors the views of all frontend components.

Testing Instructions

Everything should work the same.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Copy link
Member

@HLeithner HLeithner left a comment

Choose a reason for hiding this comment

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

Reset seems to be ok

@laoneo laoneo self-assigned this Oct 10, 2024
@laoneo laoneo added this to the Joomla! 5.3.0 milestone Oct 10, 2024
@laoneo laoneo merged commit 82b61ce into joomla:5.3-dev Oct 10, 2024
3 checks passed
@laoneo
Copy link
Member

laoneo commented Oct 10, 2024

Thanks!

$results = $this->get('Items');
$total = $this->get('Total');
$query = $model->getQuery();
$results = $model->getItems();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is $total = $this->get('Total'); removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't used so no need to carry the value

Copy link
Contributor

Choose a reason for hiding this comment

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

ok.. thx

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

Successfully merging this pull request may close these issues.

7 participants