From 8338d71347eeae7a8f0471a830d78b8f67919d26 Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@afi-sa.fr>
Date: Sat, 25 Jul 2015 15:01:15 +0200
Subject: [PATCH] dev #22209 search result feed

reification of Search Result - test fix
---
 .../ZendAfi/View/Helper/Accueil/RechGuidee.php | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/library/ZendAfi/View/Helper/Accueil/RechGuidee.php b/library/ZendAfi/View/Helper/Accueil/RechGuidee.php
index 73299426168..c663827acf5 100644
--- a/library/ZendAfi/View/Helper/Accueil/RechGuidee.php
+++ b/library/ZendAfi/View/Helper/Accueil/RechGuidee.php
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
  * along with BOKEH; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // OPAC3 - Class module Recherche Guidee
@@ -26,7 +26,7 @@ class ZendAfi_View_Helper_Accueil_RechGuidee extends ZendAfi_View_Helper_Accueil
 
 //---------------------------------------------------------------------
 // Construction du Html
-//--------------------------------------------------------------------- 
+//---------------------------------------------------------------------
   public function getHtml()
   {
     $class_rech = new Class_MoteurRecherche();
@@ -34,24 +34,22 @@ class ZendAfi_View_Helper_Accueil_RechGuidee extends ZendAfi_View_Helper_Accueil
 
     $criteres_recherche->setParams( [ 'rubrique' => 'guidee']);
 
-    $ret = $class_rech->lancerRecherche($criteres_recherche);
-
-    if($ret)
-    {
-      $rubrique = '';
-      foreach ($ret["rubriques"] as $rub) {
+    $rubrique = '';
+    if ($result = $class_rech->lancerRecherche($criteres_recherche))  {
+      foreach ($result->getRubrics() as $rub) {
         $rubrique.='<a href="'.$this->view->url($rub["url"]).'">&raquo;&nbsp;'.$rub["libelle"].'</a><br />';
       }
     }
+
     $this->titre = $this->preferences["titre"];
-    $this->contenu = 
+    $this->contenu =
       '<table width="98%">
         <tr>
           <td>'.$rubrique.'</td>
         </tr>
       </table>
       ';
-    
+
     // Retour
     return $this->getHtmlArray();
   }
-- 
GitLab