You are here

public function FrxSQLQueryBuilder::defineFilter in Forena Reports 6.2

Same name and namespace in other branches
  1. 6 FrxSQLQueryBuilder.inc \FrxSQLQueryBuilder::defineFilter()

* Add a filter object * Enter description here ... *

Parameters

unknown_type $field: * @param unknown_type $comparison * @param unknown_type $sql * @param unknown_type $title

1 call to FrxSQLQueryBuilder::defineFilter()
FrxSQLQueryBuilder::defineColumnFilters in ./FrxSQLQueryBuilder.inc
Set up common column filters This will set up all of the common filters on data ...

File

./FrxSQLQueryBuilder.inc, line 29

Class

FrxSQLQueryBuilder
FrxSQLQuery SQL Builder This class defines a common query builder that is used to make SQL safe queries based on named column filteres. @author metzlerd

Code

public function defineFilter($field, $comparison, $sql, $title = '') {

  // Intialise the field if not set
  if (!isset($this->clauses[$field])) {
    $this->clauses[$field] = array();
  }

  // Add the where clause from the lookup
  $this->clauses[$field][$comparison] = $sql;

  // Add the title
  $title = $title ? $title : $field . ' is ' . $comparison;
  $this->descriptions[$field][$comparison] = $title;
  return $this;
}