getRegistry()->register('weblinksadministrator', new AdministratorService()); $this->getRegistry()->register('weblinkicon', new Icon($container->get(SiteApplication::class))); } /** * Returns a valid section for the given section. If it is not valid then null * is returned. * * @param string $section The section to get the mapping for * @param object $item The item * * @return string|null The new section * * @since 4.0.0 */ public function validateSection($section, $item = null) { if ($section != 'weblink') { // We don't know other sections return null; } return $section; } /** * Returns valid contexts * * @return array * * @since 4.0.0 */ public function getContexts(): array { Factory::getLanguage()->load('com_weblinks', JPATH_ADMINISTRATOR); $contexts = [ 'com_weblinks.weblink' => Text::_('COM_WEBLINKS'), ]; return $contexts; } /** * Returns the table for the count items functions for the given section. * * @param string $section The section * * @return string|null * * @since 4.0.0 */ protected function getTableNameForSection(string $section = null) { return ($section === 'category' ? 'categories' : 'weblinks'); } /** * Returns the state column for the count items functions for the given section. * * @param string $section The section * * @return string|null * * @since 4.0.0 */ protected function getStateColumnForSection(string $section = null) { return 'state'; } }