_request = $request; $this->_registryManager = $registry; $this->_searchResourceModel = $searchResourceModel; } /** * {@inheritdoc} */ public function toOptionArray() { $queries = $this->_request->getPost('selected_queries'); $currentQueryId = $this->_registryManager->registry('current_catalog_search')->getId(); $queryIds = []; if ($queries === null && !empty($currentQueryId)) { $queryIds = $this->_searchResourceModel->getRelatedQueries($currentQueryId); } return $queryIds; } }