-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExportManagerInterface.php
44 lines (39 loc) · 1.71 KB
/
ExportManagerInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*
* This file is part of the Klipper package.
*
* (c) François Pluchino <francois.pluchino@klipper.dev>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Klipper\Component\Export;
use Doctrine\ORM\Query;
use Klipper\Component\Export\Exception\ExportNotFoundException;
use Klipper\Component\Export\Exception\InvalidArgumentException;
use Klipper\Component\Export\Exception\InvalidFormatException;
use Klipper\Component\Export\Exception\RuntimeException;
use Klipper\Component\Export\ViewTransformer\ExportViewTransformerInterface;
use Klipper\Component\Metadata\ObjectMetadataInterface;
/**
* @author François Pluchino <francois.pluchino@klipper.dev>
*/
interface ExportManagerInterface
{
public function addViewTransformer(ExportViewTransformerInterface $viewTransformer): void;
/**
* Build the export data.
*
* @param ObjectMetadataInterface|string $rootMetadata
* @param ExportedColumnInterface[]|string[] $fields The selected field or associations paths
* By default, only the fields of the root metadata
* @param bool $headerLabels Check if the first column display the translated labels
* or the property paths
*
* @throws InvalidFormatException
* @throws InvalidArgumentException
* @throws ExportNotFoundException
* @throws RuntimeException
*/
public function exportQuery($rootMetadata, Query $query, array $fields = [], string $format = 'xlsx', bool $headerLabels = true): ExportedDataInterface;
}