mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 22:34:24 +00:00
do not display similar search results if null
This commit is contained in:
parent
7be2d408f9
commit
99ca79d86e
@ -113,7 +113,10 @@ class SimilarityPersonSearch extends AbstractSearch
|
|||||||
$total = $this->count($terms);
|
$total = $this->count($terms);
|
||||||
$paginator = $this->paginatorFactory->create($total);
|
$paginator = $this->paginatorFactory->create($total);
|
||||||
|
|
||||||
if ($format === 'html') {
|
if ($format === 'html')
|
||||||
|
{
|
||||||
|
if ($total !== 0)
|
||||||
|
{
|
||||||
return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig',
|
return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig',
|
||||||
array(
|
array(
|
||||||
'persons' => $this->search($terms, $start, $limit, $options),
|
'persons' => $this->search($terms, $start, $limit, $options),
|
||||||
@ -127,7 +130,13 @@ class SimilarityPersonSearch extends AbstractSearch
|
|||||||
'paginator' => $paginator,
|
'paginator' => $paginator,
|
||||||
'title' => "Similar persons"
|
'title' => "Similar persons"
|
||||||
));
|
));
|
||||||
} elseif ($format === 'json') {
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif ($format === 'json')
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
'results' => $this->search($terms, $start, $limit, \array_merge($options, [ 'simplify' => true ])),
|
'results' => $this->search($terms, $start, $limit, \array_merge($options, [ 'simplify' => true ])),
|
||||||
'pagination' => [
|
'pagination' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user