icon = $class; return $this; } /** * Get the class of the icon. */ public function getIcon(): string { return $this->icon; } /** * Set the path of a CSS file that will be loaded when needed. * * @since 15.0.0 */ public function setCss(string $css): ISearchTemplate { $this->css = $css; return $this; } /** * Get the path of the CSS file. * * @since 15.0.0 */ public function getCss(): string { return $this->css; } /** * Set the path of the file of a template that the HTML will be displayed * below the Options. * This should only be used if your Content Provider needs to set options in * a way not generated by FullTextSearch * * @since 15.0.0 */ public function setTemplate(string $template): ISearchTemplate { $this->template = $template; return $this; } /** * Get the path of the template file. * * @since 15.0.0 */ public function getTemplate(): string { return $this->template; } /** * Add an option in the Panel that is displayed when the user start a search * within the app that generate the content. * * @see ISearchOption * * @since 15.0.0 */ public function addPanelOption(ISearchOption $option): ISearchTemplate { $this->panelOptions[] = $option; return $this; } /** * Get all options to be displayed in the Panel. * * @since 15.0.0 * * @return SearchOption[] */ public function getPanelOptions(): array { return $this->panelOptions; } /** * Add an option in the left panel of the FullTextSearch navigation page. * * @see ISearchOption * * @since 15.0.0 */ public function addNavigationOption(ISearchOption $option): ISearchTemplate { $this->navigationOptions[] = $option; return $this; } /** * Get all options to be displayed in the FullTextSearch navigation page. * * @since 15.0.0 */ public function getNavigationOptions(): array { return $this->navigationOptions; } /** * @since 15.0.0 */ public function jsonSerialize(): array { return [ 'icon' => $this->getIcon(), 'css' => $this->getCss(), 'template' => $this->getTemplate(), 'panel' => $this->getPanelOptions(), 'navigation' => $this->getNavigationOptions() ]; } }