re-written exporter for simpler extendability (#1349)

This commit is contained in:
Kevin Papst
2020-01-07 21:20:45 +01:00
committed by GitHub
parent d6798eed1e
commit e57b69973f
20 changed files with 497 additions and 260 deletions

View File

@@ -10,13 +10,13 @@
namespace App\Export\Base;
use App\Entity\MetaTableTypeInterface;
use App\Entity\Timesheet;
use App\Event\ActivityMetaDisplayEvent;
use App\Event\CustomerMetaDisplayEvent;
use App\Event\MetaDisplayEventInterface;
use App\Event\ProjectMetaDisplayEvent;
use App\Event\TimesheetMetaDisplayEvent;
use App\Event\UserPreferenceDisplayEvent;
use App\Export\ExportItemInterface;
use App\Repository\Query\CustomerQuery;
use App\Repository\Query\TimesheetQuery;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -54,7 +54,7 @@ class HtmlRenderer
}
/**
* @param Timesheet[] $timesheets
* @param ExportItemInterface[] $timesheets
* @param TimesheetQuery $query
* @return Response
* @throws \Twig\Error\LoaderError
@@ -63,6 +63,7 @@ class HtmlRenderer
*/
public function render(array $timesheets, TimesheetQuery $query): Response
{
/** @var CustomerQuery $customerQuery */
$customerQuery = $query->copyTo(new CustomerQuery());
$timesheetMetaFields = $this->findMetaColumns(new TimesheetMetaDisplayEvent($query, TimesheetMetaDisplayEvent::EXPORT));