Author: sevein
Date: Mon May 14 11:02:11 2012
New Revision: 11670

Log:
Use class static property  and []

Modified:
   branches/2.0/apps/qubit/modules/search/actions/indexAction.class.php

Modified: branches/2.0/apps/qubit/modules/search/actions/indexAction.class.php
==============================================================================
--- branches/2.0/apps/qubit/modules/search/actions/indexAction.class.php        
Mon May 14 10:34:20 2012        (r11669)
+++ branches/2.0/apps/qubit/modules/search/actions/indexAction.class.php        
Mon May 14 11:02:11 2012        (r11670)
@@ -39,7 +39,6 @@
       $request->limit = sfConfig::get('app_hits_per_page');
     }
 
-    // Simple search
     if (isset($request->query))
     {
       $this->title = $this->context->i18n->__('Search for [%1%]', array('%1%' 
=> $request->query));
@@ -129,8 +128,9 @@
 
               foreach ($facet['terms'] as $term)
               {
-                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array('count' => $term['count'],
-                                                  'term' => 
$reponames[$term['term']]);
+                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array(
+                  'count' => $term['count'],
+                  'term' => $reponames[$term['term']]);
               }
 
               break;
@@ -148,8 +148,9 @@
 
               foreach ($facet['terms'] as &$term)
               {
-                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array('count' => $term['count'],
-                                                               'term' => 
$subjectAPnames[$term['term']]);
+                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array(
+                  'count' => $term['count'],
+                  'term' => $subjectAPnames[$term['term']]);
               }
 
               break;
@@ -167,8 +168,9 @@
 
               foreach ($facet['terms'] as $term)
               {
-                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array('count' => $term['count'],
-                                                               'term' => 
$mediaTypeNames[$term['term']]);
+                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array(
+                  'count' => $term['count'],
+                  'term' => $mediaTypeNames[$term['term']]);
               }
 
               break;
@@ -191,8 +193,9 @@
 
               foreach ($facet['terms'] as &$term)
               {
-                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array('count' => $term['count'],
-                                                               'term' => 
$placeAPnames[$term['term']]);
+                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array(
+                  'count' => $term['count'],
+                  'term' => $placeAPnames[$term['term']]);
               }
 
               break;
@@ -210,8 +213,9 @@
 
               foreach ($facet['terms'] as &$term)
               {
-                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array('count' => $term['count'],
-                                                  'term' => 
$nameAPnames[$term['term']]);
+                $facets[strtr($name, '.', '_')]['terms'][$term['term']] = 
array(
+                  'count' => $term['count'],
+                  'term' => $nameAPnames[$term['term']]);
               }
 
               break;
@@ -290,7 +294,7 @@
 
   public function facetQuery($query)
   {
-    foreach ($this->facets as $field)
+    foreach (self::$FACETS as $field)
     {
       $facet = new Elastica_Facet_Terms($field);
       $facet->setField($field);
@@ -309,6 +313,7 @@
   public function filterQuery($query)
   {
     $this->filters = array();
+    $this->facets = array();
     $queryTerm = new Elastica_Query_Term();
     $queryBool = new Elastica_Query_Bool();
 
@@ -317,7 +322,7 @@
       $queryBool->addMust($query);
     }
 
-    foreach ($this->request->getParameterHolder()->getAll() as $param => 
$value)
+    foreach ($this->request->getGetParameters() as $param => $value)
     {
       if (in_array(strtr($param, '_', '.'), $this->facets))
       {

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to