* }>, * seconds: int, * cost: int|null * } */ private array $data; private ExportFormat $exportFormat; private string $currency; private TimeEntryAggregationType $group; private TimeEntryAggregationType $subGroup; /** * @param array{ * grouped_type: string|null, * grouped_data: null|array * }>, * seconds: int, * cost: int|null * } $data */ public function __construct(array $data, ExportFormat $exportFormat, string $currency, TimeEntryAggregationType $group, TimeEntryAggregationType $subGroup) { $this->data = $data; $this->exportFormat = $exportFormat; $this->currency = $currency; $this->group = $group; $this->subGroup = $subGroup; } public function view(): View { return view('reports.time-entry-aggregate.spreadsheet', [ 'data' => $this->data, 'currency' => $this->currency, 'group' => $this->group, 'subGroup' => $this->subGroup, 'exportFormat' => $this->exportFormat, ]); } /** * @return array */ public function getCsvSettings(): array { return [ 'delimiter' => ',', 'enclosure' => '"', 'escape_character' => '', ]; } }