1 | <?php |
||
18 | class Exporter |
||
19 | { |
||
20 | /** |
||
21 | * @var TypedWriterInterface[] |
||
22 | */ |
||
23 | private $writers; |
||
24 | |||
25 | /** |
||
26 | * @param TypedWriterInterface[] $writers an array of allowed typed writers, indexed by format name |
||
27 | */ |
||
28 | public function __construct(array $writers = array()) |
||
36 | |||
37 | /** |
||
38 | * @throws \RuntimeException |
||
39 | * |
||
40 | * @param string $format |
||
41 | * @param string $filename |
||
42 | * @param SourceIteratorInterface $source |
||
43 | * |
||
44 | * @return StreamedResponse |
||
45 | */ |
||
46 | public function getResponse($format, $filename, SourceIteratorInterface $source) |
||
70 | |||
71 | /** |
||
72 | * Returns a simple array of export formats. |
||
73 | * |
||
74 | * @return string[] writer formats as returned by the TypedWriterInterface::getFormat() method |
||
75 | */ |
||
76 | public function getAvailableFormats() |
||
80 | |||
81 | /** |
||
82 | * The main benefit of this method is the type hinting. |
||
83 | * |
||
84 | * @param TypedWriterInterface $writer a possible writer for exporting data |
||
85 | */ |
||
86 | public function addWriter(TypedWriterInterface $writer) |
||
90 | } |
||
91 |