CountField

The Contact Form DB CountField class.

Defined (1)

The class is defined in the following location(s).

/CountField.php  
  1. class CountField extends HistogramTransform { 
  2.  
  3. function __construct($valueField, $groupByField = null) { 
  4. parent::__construct($valueField, $groupByField); 
  5.  
  6. public function addEntry(&$entry) { 
  7. if (array_key_exists($this->valueField, $entry)) { 
  8. $value = $entry[$this->valueField]; 
  9. $groupByName = empty($this->groupByField) ? $this->valueField : $entry[$this->groupByField]; 
  10.  
  11. if ($value !== null && $value !== '') { 
  12. if (array_key_exists($groupByName, $this->values)) { 
  13. $this->values[$groupByName]++; 
  14. } else { 
  15. $this->values[$groupByName] = 1; 
  16.