public function GenerateCustomReport(Report_Usage $usage, Report_ResultSelection $selection, Report_GroupBy $groupBy, Report_Range $range, Report_Filter $filter) { $builder = new ReportCommandBuilder(); $selection->Add($builder); if ($selection->Equals(Report_ResultSelection::FULL_LIST)) { $usage->Add($builder); } $groupBy->Add($builder); $range->Add($builder); $filter->Add($builder); $data = $this->repository->GetCustomReport($builder); return new CustomReport($data, $this->attributeRepository); }
public function testDefaultsStartAndEnd() { $range = new Report_Range(Report_Range::DATE_RANGE, null, null, $this->timezone); $this->isTrue(Date::Min()->Equals($range->Start())); $this->isTrue(Date::Max()->Equals($range->End())); }
private function LimitToMonth(ReportCommandBuilder $builder) { $builder->Within($this->monthRange->Start(), $this->monthRange->End()); return $builder; }
/** * @static * @param array $values * @return Report_Range */ private static function GetRange($values) { if (array_key_exists('range', $values)) { $start = $values['range_start']; $end = $values['range_end']; return new Report_Range($values['range'], $start, $end, 'UTC'); } else { return Report_Range::AllTime(); } }
public function testThisMonthsAccessories() { $report = new CannedReport(CannedReport::ACCESSORIES_THISMONTH, $this->fakeUser); $range = new Report_Range(Report_Range::CURRENT_MONTH, null, null, $this->fakeUser->Timezone); $builder = $report->GetBuilder(); $expected = new ReportCommandBuilder(); $expected->SelectFullList()->OfAccessories()->Within($range->Start(), $range->End()); $this->assertEquals($expected, $builder); }