CategoryServiceTrait

Trait for component categories service.

since

4.0.0

Methods

countItems

Adds Count Items for Category Manager.

countItems(array<mixed,\stdClass> $items, string $section) : void
since

4.0.0

throws

\Exception

Arguments

$items

array<mixed,\stdClass>The category objects

$section

stringThe section

getCategory

Returns the category service.

getCategory(array $options = array(), string $section = '') : \Joomla\CMS\Categories\CategoryInterface
since

4.0.0

throws

\Joomla\CMS\Categories\SectionNotFoundException

Arguments

$options

arrayThe options

$section

stringThe section

Response

\Joomla\CMS\Categories\CategoryInterface

getStateColumnForSection

Returns the state column for the count items functions for the given section.

getStateColumnForSection(string $section = null) : string|null
since

4.0.0

Arguments

$section

stringThe section

Response

string|null

getTableNameForSection

Returns the table for the count items functions for the given section.

getTableNameForSection(string $section = null) : string|null
since

4.0.0

Arguments

$section

stringThe section

Response

string|null

prepareForm

Prepares the category form

prepareForm(\Joomla\CMS\Form\Form $form, array|object $data) : void

Arguments

$form

\Joomla\CMS\Form\FormThe form to change

$data

array|objectThe form data

setCategoryFactory

Sets the internal category factory.

setCategoryFactory(\Joomla\CMS\Categories\CategoryFactoryInterface $categoryFactory) : void
since

4.0.0

Arguments

$categoryFactory

\Joomla\CMS\Categories\CategoryFactoryInterfaceThe categories factory

Properties

categoryFactory

The categories factory