private function limitFilter(module_report $report) { $p = $report->getNbPage(); $r = $report->getNbRecord(); $this->filter['limit'] = false; if ($p && $r) { $limit_inf = (int) ($p - 1) * $r; $limit_sup = (int) $r; $this->filter['limit'] = " LIMIT " . $limit_inf . ', ' . $limit_sup; } return; }
public function testGetterSetter() { $report = new module_report(self::$DI['app'], $this->dmin, $this->dmax, 1, ''); $bool = true; $report->setPrettyString($bool); $this->assertEquals($bool, $report->getPrettyString()); $title = 'test'; $report->setTitle($title); $this->assertEquals($title, $report->getTitle()); $bool = false; $report->setCsv($bool); $this->assertEquals($bool, $report->getCsv()); $filter = ['test', 'array']; $report->setFilter($filter); $this->assertEquals($filter, $report->getTabFilter()); $periode = "2 years"; $report->setPeriode($periode); $this->assertEquals($periode, $report->getPeriode()); $postingFilter = 'my posting filter !'; $report->setpostingFilter($postingFilter); $this->assertEquals($postingFilter, $report->getPostingFilter()); $page = 223; $limit = 125; $report->setLimit($page, $limit); $this->assertEquals($page, $report->getNbPage()); $this->assertEquals($limit, $report->getNbRecord()); $report->setGroupBy($bool); $this->assertEquals($bool, $report->getGroupBy()); $column = ['col1', 'col2']; $report->setActiveColumn($column); $this->assertEquals($column, $report->getActiveColumn()); $report->setConfig($bool); $report->setPrint($bool); $report->setHasLimit($bool); $this->assertFalse($report->getConfig()); $this->assertFalse($report->getPrint()); $this->assertFalse($report->getHasLimit()); $result = ['result', 'result']; $report->setResult($result); $this->assertEquals($result, $report->getResult()); $total = 3200; $report->setTotal($total); $this->assertEquals($total, $report->getTotal()); $default_display = ['a', 'b', 'c']; $report->setDefault_display($default_display); $this->assertEquals($default_display, $report->getDefault_display()); }