在 joomla 6 中,adminmodel 中的 getitem() 方法将返回 stdclass 而不是 cmsobject。 这意味着该类的所有已弃用的功能将不可用。 joomla 6 中的开发人员应该直接使用 item 对象的属性,而不是使用过时的 set() 和 get() 方法。
$article = $app->bootcomponent('content')->getmvcfactory()->createmodel('article', 'administrator')->getitem(1); echo $article->get('title');
$article = $app->bootComponent('content')->getMVCFactory()->createModel('Article', 'Administrator')->getItem(1); echo $article->title;
相应的 pull request 已被 joomla 6 分支接受。
joomla github 上的公关