/**
  * Renders this widget via the given view and returns the
  * HTML as a string
  *
  * @param \Zend_View_Abstract $view
  * @return string
  */
 public function render(Zend_View_Abstract $view)
 {
     $this->urlFilter = new UrlViewFilter();
     if ($this->tree->root == null) {
         return '';
     }
     $this->buildBaseUrl();
     return $this->nodeToBadge(Tree::normalizeTree($this->tree->root));
 }
Ejemplo n.º 2
0
 /**
  * Apply the given tree to the query, either as where or as having clause
  *
  * @param Tree $tree                        The tree representing the filter
  * @param \Zend_Db_Select $baseQuery        The query to apply the filter on
  */
 public function treeToSql(Tree $tree, $baseQuery)
 {
     if ($tree->root == null) {
         return;
     }
     $sql = $this->nodeToSqlQuery($tree->normalizeTree($tree->root));
     if ($this->filtersAggregate()) {
         $baseQuery->having($sql);
     } else {
         $baseQuery->where($sql);
     }
 }