diff options
Diffstat (limited to 'plugins/ExampleUI/API.php')
-rw-r--r-- | plugins/ExampleUI/API.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/ExampleUI/API.php b/plugins/ExampleUI/API.php index 1a606d0f16..8d741a8c2b 100644 --- a/plugins/ExampleUI/API.php +++ b/plugins/ExampleUI/API.php @@ -26,11 +26,11 @@ class Piwik_ExampleUI_API return self::$instance; } - function getTemperaturesEvolution($date, $period) + public function getTemperaturesEvolution($date, $period) { $period = new Piwik_Period_Range($period, 'last30'); - $dateStart = $period->getDateStart()->get('Y-m-d'); // eg. "2009-04-01" - $dateEnd = $period->getDateEnd()->get('Y-m-d'); // eg. "2009-04-30" + $dateStart = $period->getDateStart()->toString('Y-m-d'); // eg. "2009-04-01" + $dateEnd = $period->getDateEnd()->toString('Y-m-d'); // eg. "2009-04-30" // here you could select from your custom table in the database, eg. $query = "SELECT AVG(temperature) @@ -56,7 +56,7 @@ class Piwik_ExampleUI_API } // we generate an array of random server temperatures - function getTemperatures() + public function getTemperatures() { $xAxis = array( '0h', '1h', '2h', '3h', '4h', '5h', '6h', '7h', '8h', '9h', '10h', '11h', @@ -75,7 +75,7 @@ class Piwik_ExampleUI_API return $dataTable; } - function getPlanetRatios() + public function getPlanetRatios() { $planetRatios = array( 'Mercury' => 0.382, @@ -93,7 +93,7 @@ class Piwik_ExampleUI_API return $dataTable; } - function getPlanetRatiosWithLogos() + public function getPlanetRatiosWithLogos() { $planetsDataTable = $this->getPlanetRatios(); foreach($planetsDataTable->getRows() as $row) |