Graph::CheckValues PHP Метод

CheckValues() защищенный Метод

Checks that the data are valid
protected CheckValues ( &$values )
    protected function CheckValues(&$values)
    {
        if (count($values) == 0 || count($values[0]) == 0) {
            throw new Exception('No data');
        }
    }

Usage Example

Пример #1
0
 /**
  * Checks that the data are valid
  */
 protected function CheckValues()
 {
     parent::CheckValues();
     if ($this->GetMinValue() < 0) {
         throw new Exception('Negative value for pie chart');
     }
     $sum = 0;
     foreach ($this->values[0] as $item) {
         $sum += $item->value;
     }
     if ($sum <= 0) {
         throw new Exception('Empty pie chart');
     }
     $this->total = $sum;
 }
All Usage Examples Of Graph::CheckValues