Back to CategoryServiceTrait class

Method getCategory

public \Joomla\CMS\Categories\CategoryInterface
getCategory
(array $options = [], mixed $section = '')
Returns the category service.
Parameters
  • array $options The options
  • string $section The section
Returns
  • \Joomla\CMS\Categories\CategoryInterface
Since
  • 4.0.0
-
  • \Joomla\CMS\Categories\SectionNotFoundException

Method getCategory - Source code

/**
 * Returns the category service.
 *
 * @param   array   $options  The options
 * @param   string  $section  The section
 *
 * @return  CategoryInterface
 *
 * @since   4.0.0
 * @throws  SectionNotFoundException
 */
public function getCategory(array $options = [], $section = '') : CategoryInterface
{
    return $this->categoryFactory->createCategory($options, $section);
}