@@ 126-138 (lines=13) @@ | ||
123 | { |
|
124 | $definitions = []; |
|
125 | ||
126 | if (class_exists('\League\Csv\Writer')) { |
|
127 | $csvExportFormatter = new Definition( |
|
128 | \Netgen\InformationCollection\Core\Export\CsvExportResponseFormatter::class |
|
129 | ); |
|
130 | $csvExportFormatter->addTag('netgen_information_collection.export.formatter'); |
|
131 | $csvExportFormatter->addArgument(new Reference('ezpublish.translation_helper')); |
|
132 | $csvExportFormatter->addArgument(new Reference('ezpublish.config.resolver')); |
|
133 | $csvExportFormatter->setPublic(false); |
|
134 | $csvExportFormatter->setAutowired(false); |
|
135 | $csvExportFormatter->setAutoconfigured(false); |
|
136 | ||
137 | $definitions[] = $csvExportFormatter; |
|
138 | } |
|
139 | ||
140 | if (class_exists('\PHPExcel')) { |
|
141 | $xlsExportFormatter = new Definition( |
|
@@ 140-151 (lines=12) @@ | ||
137 | $definitions[] = $csvExportFormatter; |
|
138 | } |
|
139 | ||
140 | if (class_exists('\PHPExcel')) { |
|
141 | $xlsExportFormatter = new Definition( |
|
142 | \Netgen\InformationCollection\Core\Export\XlsExportResponseFormatter::class |
|
143 | ); |
|
144 | $xlsExportFormatter->addTag('netgen_information_collection.export.formatter'); |
|
145 | $xlsExportFormatter->addArgument(new Reference('ezpublish.translation_helper')); |
|
146 | $xlsExportFormatter->setPublic(false); |
|
147 | $xlsExportFormatter->setAutowired(false); |
|
148 | $xlsExportFormatter->setAutoconfigured(false); |
|
149 | ||
150 | $definitions[] = $xlsExportFormatter; |
|
151 | } |
|
152 | ||
153 | if (!empty($definitions)) { |
|
154 | $container->addDefinitions($definitions); |