ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
sspmod_statistics_RatioDataset Class Reference
+ Inheritance diagram for sspmod_statistics_RatioDataset:
+ Collaboration diagram for sspmod_statistics_RatioDataset:

Public Member Functions

 aggregateSummary ()
 
 combine ($result1, $result2)
 
 getPieData ()
 
- Public Member Functions inherited from sspmod_statistics_StatDataset
 __construct ($statconfig, $ruleconfig, $ruleid, $timeres, $fileslot)
 Constructor. More...
 
 getFileSlot ()
 
 getTimeRes ()
 
 setDelimiter ($delimiter='_')
 
 getDelimiter ()
 
 calculateMax ()
 
 getDebugData ()
 
 aggregateSummary ()
 
 getTopDelimiters ()
 
 availDelimiters ()
 
 getPieData ()
 
 getMax ()
 
 getSummary ()
 
 getResults ()
 
 getAxis ()
 
 getPercentValues ()
 
 getDelimiterPresentation ()
 
 getDelimiterPresentationPie ()
 
 loadData ()
 

Private Member Functions

 ag ($k, $a)
 
 divide ($v1, $v2)
 

Additional Inherited Members

- Protected Attributes inherited from sspmod_statistics_StatDataset
 $statconfig
 
 $ruleconfig
 
 $timeresconfig
 
 $ruleid
 
 $fileslot
 
 $timeres
 
 $delimiter
 
 $results
 
 $summary
 
 $max
 
 $datehandlerFile
 
 $datehandlerTick
 

Detailed Description

Definition at line 6 of file RatioDataset.php.

Member Function Documentation

◆ ag()

sspmod_statistics_RatioDataset::ag (   $k,
  $a 
)
private

Definition at line 41 of file RatioDataset.php.

42 {
43 if (array_key_exists($k, $a)) {
44 return $a[$k];
45 }
46 return 0;
47 }

Referenced by combine().

+ Here is the caller graph for this function:

◆ aggregateSummary()

sspmod_statistics_RatioDataset::aggregateSummary ( )

Aggregate summary table from dataset. To be used in the table view.

Reimplemented from sspmod_statistics_StatDataset.

Definition at line 8 of file RatioDataset.php.

9 {
13 $this->summary = array();
14 $noofvalues = array();
15 foreach ($this->results as $slot => $res) {
16 foreach ($res AS $key => $value) {
17 if (array_key_exists($key, $this->summary)) {
18 $this->summary[$key] += $value;
19 if ($value > 0) {
20 $noofvalues[$key]++;
21 }
22 } else {
23 $this->summary[$key] = $value;
24 if ($value > 0) {
25 $noofvalues[$key] = 1;
26 } else {
27 $noofvalues[$key] = 0;
28 }
29 }
30 }
31 }
32
33 foreach ($this->summary as $key => $val) {
34 $this->summary[$key] = $this->divide($this->summary[$key], $noofvalues[$key]);
35 }
36
37 asort($this->summary);
38 $this->summary = array_reverse($this->summary, true);
39 }
$key
Definition: croninfo.php:18
foreach($_POST as $key=> $value) $res

References $key, $res, and divide().

+ Here is the call graph for this function:

◆ combine()

sspmod_statistics_RatioDataset::combine (   $result1,
  $result2 
)

Definition at line 57 of file RatioDataset.php.

58 {
59 $combined = array();
60
61 foreach ($result2 as $tick => $val) {
62 $combined[$tick] = array();
63 foreach ($val as $index => $num) {
64 $combined[$tick][$index] = $this->divide(
65 $this->ag($index, $result1[$tick]),
66 $this->ag($index, $result2[$tick])
67 );
68 }
69 }
70 return $combined;
71 }
$index
Definition: metadata.php:60

References $index, ag(), and divide().

+ Here is the call graph for this function:

◆ divide()

sspmod_statistics_RatioDataset::divide (   $v1,
  $v2 
)
private

Definition at line 49 of file RatioDataset.php.

50 {
51 if ($v2 == 0) {
52 return 0;
53 }
54 return ($v1 / $v2);
55 }

Referenced by aggregateSummary(), and combine().

+ Here is the caller graph for this function:

◆ getPieData()

sspmod_statistics_RatioDataset::getPieData ( )

Reimplemented from sspmod_statistics_StatDataset.

Definition at line 73 of file RatioDataset.php.

74 {
75 return null;
76 }

The documentation for this class was generated from the following file: