getLastDate() public method

public getLastDate ( ) : string
return string
Beispiel #1
0
 public function getAllWithGroups()
 {
     Piwik::checkUserHasSomeViewAccess();
     $period = Common::getRequestVar('period', null, 'string');
     $date = Common::getRequestVar('date', null, 'string');
     $segment = Common::getRequestVar('segment', false, 'string');
     $pattern = Common::getRequestVar('pattern', '', 'string');
     $limit = Common::getRequestVar('filter_limit', 0, 'int');
     $segment = $segment ?: false;
     $request = $_GET + $_POST;
     $dashboard = new Dashboard($period, $date, $segment);
     if ($pattern !== '') {
         $dashboard->search(strtolower($pattern));
     }
     $response = array('numSites' => $dashboard->getNumSites(), 'totals' => $dashboard->getTotals(), 'lastDate' => $dashboard->getLastDate(), 'sites' => $dashboard->getSites($request, $limit));
     return json_encode($response);
 }
Beispiel #2
0
 public function test_getLastDate_shouldReturnAnEmptyString_IfNoLastDateIsSet()
 {
     $this->dashboard->setSitesTable(new DataTable());
     $this->assertSame('', $this->dashboard->getLastDate());
 }