In a custom template helper of com_content I need to get all children categories from specific category.
$categories = Joomla\CMS\Categories\Categories::getInstance('content');
$cat = $categories->get($id);
return $cat->getChildren();
But getInstance
will be deprecated in J5:
@deprecated 5.0 Use the ComponentInterface to get the categories.
Please, what is the substitution method?