Esempio n. 1
0
 /**
  * Returns the condition to be used with SQL where
  * @param array $data filter settings
  * @return string the filtering condition or null if the filter is disabled
  */
 function get_sql_filter($data)
 {
     if ($data['value'] === 0) {
         return 'TRUE';
     }
     return parent::get_sql_filter($data);
 }
Esempio n. 2
0
 /**
  * Returns the condition to be used with SQL where
  * @param array $data filter settings
  * @return array the filtering condition with optional parameters 
  *               or null if the filter is disabled
  */
 function get_sql_filter($data)
 {
     if ($data['value'] === 0) {
         return array('TRUE', array());
     }
     return parent::get_sql_filter($data);
 }
Esempio n. 3
0
 /**
  * Returns the condition to be used with SQL where
  * @uses $CFG
  * @param array $data filter settings
  * @return string the filtering condition or null if the filter is disabled
  */
 function get_sql_filter($data)
 {
     global $CFG;
     $sql = parent::get_sql_filter($data);
     $full_fieldname = $this->get_full_fieldname();
     if (empty($full_fieldname)) {
         return null;
     }
     $sql = "{$this->_outerfield} IN " . " (SELECT {$this->_innerfield}" . ' FROM ' . $CFG->prefix . $this->_table . ' ' . $this->_alias . $this->_wrapper . '  WHERE ' . $sql . ')';
     return $sql;
 }