Skip to content

Commit 81e2a58

Browse files
Hackwarlaoneo
andauthored
[5.3] Deprecate AbstractView::get() (joomla#44162)
* Deprecate AbstractView::get() * Adding deprecation trigger to AbstractView::get() * Update libraries/src/MVC/View/AbstractView.php Co-authored-by: Allon Moritz <[email protected]>
1 parent 6ab1ee9 commit 81e2a58

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

libraries/src/MVC/View/AbstractView.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,21 @@ abstract public function display($tpl = null);
138138
* @return mixed The return value of the method
139139
*
140140
* @since 3.0
141+
*
142+
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0.
143+
* Retrieve the model with $model = $this->getModel(); and call the methods
144+
* to the model directly, e.g. $model->getItems() instead of $this->get('Items').
141145
*/
142146
public function get($property, $default = null)
143147
{
148+
trigger_deprecation(
149+
'joomla/mvc/view',
150+
'5.3',
151+
'The %s() method is deprecated and will be removed in 7.0. use $model = $this->getModel();
152+
$this->items = $model->getItems(); instead',
153+
__METHOD__
154+
);
155+
144156
// If $model is null we use the default model
145157
if ($default === null) {
146158
$model = $this->_defaultModel;

0 commit comments

Comments
 (0)