Skip to content

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

Open
Hackwar wants to merge 5 commits into
joomla:7.0-devfrom
Hackwar:7.0-model-databaseawaretrait
Open

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

Conversation

@Hackwar

@Hackwar Hackwar commented Mar 20, 2026

Copy link
Copy Markdown
Member
  • 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.

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.

Then load it from the container at least.

@Hackwar
Hackwar marked this pull request as ready for review April 23, 2026 11:57
@laoneo laoneo added Architecture Pull requests which improve the architecture. Updates Requested Indicates that this pull request needs an update from the author and should not be tested. labels Jun 18, 2026
chmst
chmst previously approved these changes Jul 4, 2026
@chmst
chmst dismissed their stale review July 4, 2026 20:03

wrong PR

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

Labels

Architecture Pull requests which improve the architecture. b/c break This item changes the behavior in an incompatible why. HEADS UP PR-7.0-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants