JTABLE-GETINSTANCE-001
JTable::getInstance('Content')
Table::getInstance()
String-based getInstance is deprecated. Namespaced tables should come from the component factory.
JTable::getInstance('Content') → MVC / Table factory
What you will see
- Table class not found
Symptoms people search
cannot store row after namespace move
Replace this code
Swap JTable::getInstance('Content') for MVC / Table factory.
Joomla 3
Remove or stop calling this
$table = JTable::getInstance('LmsCourse', 'Table');Joomla 4 / 6
Use this instead
$table = $this->getTable('Course');
// or the MVC factory table methodHow to fix it
- 1Use $this->getTable() in models.
- 2Register the table with MVC Factory.
Also known as
JTable::getInstance · getTable
Related issues
- Joomla 3 → 4MVC
getError() / setError() on models and tables
$model->setError() → Exceptions
- Joomla 3 → 4MVC
assignRef() on views
$this->assignRef('item', $item) → $this->item = $item
- Joomla 3 → 4MVC
JTableObserver*
JTableObserverTags → Core plugins (tags, content history) — do not subclass observers
- Joomla 3 → 4MVC
FOF 2.x in core
FOFModel / FOFTable → FOF 3 / native Joomla MVC
- Joomla 3 → 4MVC
Experimental Joomla 3 “new MVC” namespace
Joomla\CMS\MVC (J3 experimental) → Original MVC: HtmlView, ListModel, BaseController
- Joomla 5 → 6MVC
getInstance() on MVC classes
JModelLegacy::getInstance() → $this->getModel() / MVCFactory