示例#1
0
 /**
  * Render a qparser plugin call
  *
  * @param string $name
  * @param array $params
  * @param boolean $dereferenced
  * @return string
  */
 public function qparser($name, $params = array(), $dereferenced = false)
 {
     if ($dereferenced) {
         if (!$this->_query) {
             throw new Solarium_Exception('Dereferenced params can only be used in a Solarium_Query_Helper instance retrieved from the query ' . 'by using the getHelper() method, this instance was manually created');
         }
         foreach ($params as $paramKey => $paramValue) {
             $this->_derefencedParamsLastKey++;
             $derefKey = 'deref_' . $this->_derefencedParamsLastKey;
             $this->_query->addParam($derefKey, $paramValue);
             $params[$paramKey] = '$' . $derefKey;
         }
     }
     $output = '{!' . $name;
     foreach ($params as $key => $value) {
         $output .= ' ' . $key . '=' . $value;
     }
     $output .= '}';
     return $output;
 }