Commit f28c693d by Van

Normalement c'est good la surcharge

parent c66488f1
...@@ -57,35 +57,37 @@ class SearchController extends Base ...@@ -57,35 +57,37 @@ class SearchController extends Base
public function search() public function search()
{ {
$formData = $this->app['request']->request->get('resa'); $formData = $this->app['request']->request->get('resa');
if ($formData){
if(!empty($formData['Type'])) { if(!empty($formData['Type'])) {
foreach ($formData['Type'] as $typology) { foreach ($formData['Type'] as $typology) {
$this->contentSlugs[] = (!empty($this->configContent[$typology]['slug'])) ? $this->configContent[$typology]['slug'] : null; $this->contentSlugs[] = (!empty($this->configContent[$typology]['slug'])) ? $this->configContent[$typology]['slug'] : null;
}
} }
}
$this->_saveBaseFormData();
try { $this->_saveBaseFormData();
$this->ellohaRequest
->setData($formData)
->launchApiSearch()
;
} finally {
$idsProduct = $this->ellohaRequest->getIdProducts();
$results = $this->_searchReservableContents($idsProduct, $formData);
try { try {
return $this->render($this->config['results_elloha_template'], [ $this->ellohaRequest
'results' => $results ->setData($formData)
]); ->launchApiSearch()
} catch (\Exception $e) { ;
return $this->render('@elloha/Frontend/search/results.html.twig', [ } finally {
'results' => $results $idsProduct = $this->ellohaRequest->getIdProducts();
]); $results = $this->_searchReservableContents($idsProduct, $formData);
try {
return $this->render($this->config['results_elloha_template'], [
'results' => $results
]);
} catch (\Exception $e) {
return $this->render('@elloha/Frontend/search/results.html.twig', [
'results' => $results
]);
}
} }
} }
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment