. */ declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use Illuminate\Support\Collection; /** * Class MonthReportGenerator * * @package FireflyIII\Generator\Report\Standard */ class MultiYearReportGenerator implements ReportGeneratorInterface { /** @var Collection */ private $accounts; /** @var Carbon */ private $end; /** @var Carbon */ private $start; /** * @return string */ public function generate(): string { // and some id's, joined: $accountIds = join(',', $this->accounts->pluck('id')->toArray()); $reportType = 'default'; // continue! return view( 'reports.default.multi-year', compact('accountIds', 'reportType') )->with('start', $this->start)->with('end', $this->end)->render(); } /** * @param Collection $accounts * * @return ReportGeneratorInterface */ public function setAccounts(Collection $accounts): ReportGeneratorInterface { $this->accounts = $accounts; return $this; } /** * @param Collection $budgets * * @return ReportGeneratorInterface */ public function setBudgets(Collection $budgets): ReportGeneratorInterface { return $this; } /** * @param Collection $categories * * @return ReportGeneratorInterface */ public function setCategories(Collection $categories): ReportGeneratorInterface { return $this; } /** * @param Carbon $date * * @return ReportGeneratorInterface */ public function setEndDate(Carbon $date): ReportGeneratorInterface { $this->end = $date; return $this; } /** * @param Carbon $date * * @return ReportGeneratorInterface */ public function setStartDate(Carbon $date): ReportGeneratorInterface { $this->start = $date; return $this; } /** * @param Collection $tags * * @return ReportGeneratorInterface */ public function setTags(Collection $tags): ReportGeneratorInterface { return $this; } }