Skip to content

Commit

Permalink
[5.3] Deprecate AbstractView::get() (#44162)
Browse files Browse the repository at this point in the history
* Deprecate AbstractView::get()

* Adding deprecation trigger to AbstractView::get()

* Update libraries/src/MVC/View/AbstractView.php

Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
  • Loading branch information
Hackwar and laoneo authored Oct 5, 2024
1 parent 6ab1ee9 commit 81e2a58
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/src/MVC/View/AbstractView.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,21 @@ abstract public function display($tpl = null);
* @return mixed The return value of the method
*
* @since 3.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0.
* Retrieve the model with $model = $this->getModel(); and call the methods
* to the model directly, e.g. $model->getItems() instead of $this->get('Items').
*/
public function get($property, $default = null)
{
trigger_deprecation(
'joomla/mvc/view',
'5.3',
'The %s() method is deprecated and will be removed in 7.0. use $model = $this->getModel();
$this->items = $model->getItems(); instead',
__METHOD__
);

// If $model is null we use the default model
if ($default === null) {
$model = $this->_defaultModel;
Expand Down

0 comments on commit 81e2a58

Please sign in to comment.