I'm running Joomla 3.9.5 and I'm attempting to update my
JFactory::getDbo() calls (which are deprecated) to the newer format using the container. However, I'm getting the following error:
Call to undefined method Joomla\CMS\Factory::getContainer()
The code looks like
$db = \Joomla\CMS\Factory::getContainer()->get('DatabaseDriver');
which looks the same as what's being used in the deprecated method in
self::$database = self::getContainer()->get('DatabaseDriver');
What's the right way to get a DBO in the new containerized system?