From the documentation I use this part to store a large chunk of data
if (empty($families)) {
$cache = Factory::getCache();
$families = $cache->call( array( 'JFormFieldFamily', 'getFamilyList' ) );
}
Working perfectly on my Joomla 3.9.6, however my extension in Joomla 4 throws this
Warning: call_user_func_array() expects parameter 1 to be a valid callback,
class 'Joomla\CMS\Cache\Cache' does not have a method 'call' in
site\libraries\src\Cache\CacheController.php on line 74
Looking into the documentation for Joomla\CMS\Cache\Cache
$families = $cache->call( array( 'JFormFieldFamily', 'getFamilyList' ) );
becomes
$families = $cache->get( array( 'JFormFieldFamily', 'getFamilyList' ) );
and works properly on Joomla 3.9/4.
Do I need to use $cache->store()
method?