<?php
namespace ModulesAbstract\PluginReports\Report\Model\Exporter; class MergeExporter extends ExporterWithStorageAbstract { protected $exporters = []; public function addExporter(\ModulesAbstract\PluginReports\Report\Model\Exporter\ExporterAbstract $exporter) { $exporter->setParentExporter($this); $this->exporters[] = $exporter; return $this; } public function getRequiredFilters() { $requiredFilters= []; foreach ($this->exporters as $exporter) { $requiredFilters = array_merge($requiredFilters, $exporter->getRequiredFilters()); } return array_unique($requiredFilters); } public function addFilter($key, $value) { $this->filters[$key] = $value; foreach ($this->exporters as $exporter) { $exporter->addFilter($key, $value); } return $this; } public function setErrorReport(\ModulesAbstract\PluginReports\Report\Model\ErrorReport $errorReport) { foreach ($this->exporters as $exporter) { $exporter->setErrorReport($errorReport); } return $this; } protected function objectInitialize() { foreach ($this->exporters as $exporter) { $exporter->objectInitialize(); } } public function setReportBasePath($basePath) { foreach ($this->exporters as $exporter) { $exporter->setReportBasePath($basePath); } return $this; } public function exportRow($row) { foreach ($this->exporters as $exporter) { $exporter->exportRow($row); } return $this; } public function exportReport() { foreach ($this->exporters as $exporter) { $exporter->exportReport(); } } } 