![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/CoreBundle/Event/ |
<?php namespace Mautic\CoreBundle\Event; use Mautic\CoreBundle\Translation\Translator; use Symfony\Contracts\EventDispatcher\Event; class GlobalSearchEvent extends Event { /** * @var array */ protected $results = []; protected string $searchString; /** * @param string $searchString * @param Translator $translator */ public function __construct( $searchString, protected $translator ) { $this->searchString = strtolower(trim(strip_tags($searchString))); } /** * Returns the string to be searched. */ public function getSearchString(): string { return $this->searchString; } /** * Add an array of results from a search query to be listed in right side panel * Each result should be the ENTIRE html to be rendered. * * @param string $header String name for section header * @param array $results Array of HTML output that will be wrapped in <li /> elements */ public function addResults($header, array $results): void { $header = $this->translator->trans($header); $this->results[$header] = $results; } /** * Returns the results. * * @return array */ public function getResults() { uksort($this->results, 'strnatcmp'); return $this->results; } }