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