1 | <?php |
||
16 | class CsvExport extends Part |
||
17 | { |
||
18 | |||
19 | private $fileName = 'data.csv'; |
||
20 | private $csvDelimiter = ';'; |
||
21 | private $exitFunction; |
||
22 | |||
23 | /** |
||
24 | * @var InputOption |
||
25 | */ |
||
26 | private $inputOption; |
||
27 | |||
28 | public function __construct(InputOption $inputOption = null, ViewComponentInterface $controlView = null) |
||
33 | |||
34 | /** |
||
35 | * @param InputOption $inputOption |
||
36 | * @return CsvExport |
||
37 | */ |
||
38 | public function setInputOption($inputOption) |
||
43 | |||
44 | /** |
||
45 | * @return InputOption |
||
46 | */ |
||
47 | public function getInputOption() |
||
48 | { |
||
49 | return $this->inputOption; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Sets exit function. |
||
54 | * |
||
55 | * You may specify custom exit function to finish application cleanly. |
||
56 | * 'exit' will be called after rendering CSV if no exit function specified. |
||
57 | * |
||
58 | * @param callable|null $exitFunction |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function setExitFunction($exitFunction) |
||
62 | { |
||
63 | $this->exitFunction = $exitFunction; |
||
64 | return $this; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return callable|null |
||
69 | */ |
||
70 | public function getExitFunction() |
||
71 | { |
||
72 | return $this->exitFunction; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getCsvDelimiter() |
||
79 | { |
||
80 | return $this->csvDelimiter; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @param string $csvDelimiter |
||
85 | * @return $this |
||
86 | */ |
||
87 | public function setCsvDelimiter($csvDelimiter) |
||
88 | { |
||
89 | $this->csvDelimiter = $csvDelimiter; |
||
90 | return $this; |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * @param string $name |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function setFileName($name) |
||
98 | { |
||
99 | $this->fileName = $name; |
||
100 | return $this; |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getFileName() |
||
107 | { |
||
108 | return $this->fileName; |
||
109 | } |
||
110 | |||
111 | public function attachToCompound(Compound $root, $prepend = false) |
||
121 | |||
122 | protected function removePagination(DataProviderInterface $provider) |
||
129 | |||
130 | protected function renderCsv() |
||
131 | { |
||
132 | ob_clean(); // removes previous output from buffer if grid was rendered inside view |
||
133 | $file = fopen('php://output', 'w'); |
||
134 | header('Content-Type: text/csv'); |
||
135 | header('Content-Disposition: attachment; filename="' . $this->getFileName() . '"'); |
||
136 | header('Pragma: no-cache'); |
||
154 | |||
155 | protected function escapeString($str) |
||
159 | |||
160 | /** |
||
161 | * @param resource $file |
||
162 | */ |
||
163 | protected function renderHeadingRow($file) |
||
173 | |||
174 | protected function finishApplication() |
||
181 | |||
182 | public function getExportUrl() |
||
186 | |||
187 | protected function makeDefaultView() |
||
201 | } |
||
202 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.