. */ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Application; use SP\Core\Events\Event; use SP\Modules\Web\Controllers\Helpers\Account\AccountSearchHelper; use SP\Modules\Web\Util\ErrorUtil; use SP\Mvc\Controller\WebControllerHelper; /** * Class IndexController */ final class IndexController extends AccountControllerBase { private AccountSearchHelper $accountSearchHelper; public function __construct( Application $application, WebControllerHelper $webControllerHelper, AccountSearchHelper $accountSearchHelper ) { parent::__construct( $application, $webControllerHelper ); $this->accountSearchHelper = $accountSearchHelper; } /** * Index action * */ public function indexAction(): void { try { $this->accountSearchHelper->getSearchBox(); $this->accountSearchHelper->getAccountSearch(); $this->eventDispatcher->notify('show.account.search', new Event($this)); $this->view(); } catch (Exception $e) { processException($e); $this->eventDispatcher->notify('exception', new Event($e)); ErrorUtil::showExceptionInView($this->view, $e); } } }