Exemple #1
0
 /**
  * Retrieves the sorts set for this query.
  *
  * @return array
  *   An array specifying the sort order for this query. Array keys are the
  *   field names in order of importance, the values are the respective order
  *   in which to sort the results according to the field.
  *
  * @see sort()
  *
  * @see \Drupal\search_api\Query\QueryInterface::getSorts()
  */
 public function &getSort() {
   if (!$this->shouldAbort()) {
     return $this->query->getSorts();
   }
   $ret = NULL;
   return $ret;
 }
Exemple #2
0
 public function setSorts(Query $solarium_query, QueryInterface $query, $field_names_single_value = array())
 {
     foreach ($query->getSorts() as $field => $order) {
         $f = $field_names_single_value[$field];
         if (substr($f, 0, 3) == 'ss_') {
             $f = 'sort_' . substr($f, 3);
         }
         $solarium_query->addSort($f, strtolower($order));
     }
 }