Skip to content

[7.0] Remove setDbo() and __get() from BaseDatabaseModel#47441

Open
Hackwar wants to merge 4 commits intojoomla:7.0-devfrom
Hackwar:7.0-model-databaseawaretrait
Open

[7.0] Remove setDbo() and __get() from BaseDatabaseModel#47441
Hackwar wants to merge 4 commits intojoomla:7.0-devfrom
Hackwar:7.0-model-databaseawaretrait

Conversation

@Hackwar
Copy link
Copy Markdown
Member

@Hackwar Hackwar commented Mar 20, 2026

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This removes the deprecated methods setDbo() and __get() from the BaseDatabaseModel and all usages of getDbo() from the CMS. Especially in the updater we can remove the checks, since we can't update from 4.x to 7.0 without first going through 5.4 and 6.4.

Testing Instructions

Codereview

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org: Removal of setDbo()/_db Manual#618

  • No documentation changes for manual.joomla.org needed

@HLeithner HLeithner added the b/c break This item changes the behavior in an incompatible why. HEADS UP label Apr 2, 2026

// @todo Moves queries out of the controller.
$db = $model->getDbo();
$db = Factory::getDbo();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Better to move the whole logic with database access to the model.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, but that is a bit outside of the scope of this PR.

@Hackwar Hackwar marked this pull request as ready for review April 23, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b/c break This item changes the behavior in an incompatible why. HEADS UP PR-7.0-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants