1 | <?php |
||
21 | class AdminExporter |
||
22 | { |
||
23 | /** |
||
24 | * @var TokenStorageInterface |
||
25 | */ |
||
26 | protected $tokenStorage; |
||
27 | |||
28 | /** |
||
29 | * @var TranslatorInterface |
||
30 | */ |
||
31 | protected $translator; |
||
32 | |||
33 | /** |
||
34 | * @var \Twig_Environment |
||
35 | */ |
||
36 | protected $twig; |
||
37 | |||
38 | /** |
||
39 | * @var Router |
||
40 | */ |
||
41 | protected $router; /** |
||
42 | * @var Exporter service from the exporter bundle |
||
43 | */ |
||
44 | private $exporter; |
||
45 | |||
46 | /** |
||
47 | * @param Exporter will be used to get global settings |
||
48 | */ |
||
49 | public function __construct(Exporter $exporter) |
||
53 | |||
54 | /** |
||
55 | * Queries an admin for its default export formats, and falls back on global settings. |
||
56 | * |
||
57 | * @param AdminInterface $admin the current admin object |
||
58 | * |
||
59 | * @return string[] an array of formats |
||
60 | */ |
||
61 | public function getAvailableFormats(AdminInterface $admin) |
||
72 | |||
73 | /** |
||
74 | * Builds an export filename from the class associated with the provided admin, |
||
75 | * the current date, and the provided format. |
||
76 | * |
||
77 | * @param AdminInterface $admin the current admin object |
||
78 | * @param string $format the format of the export file |
||
79 | */ |
||
80 | public function getExportFilename(AdminInterface $admin, $format) |
||
91 | |||
92 | /** |
||
93 | * setTokenStorage. |
||
94 | * |
||
95 | * @param $tokenStorage TokenStorageInterface |
||
96 | */ |
||
97 | public function setTokenStorage(TokenStorageInterface $tokenStorage) |
||
103 | |||
104 | /** |
||
105 | * setTranslator. |
||
106 | * |
||
107 | * @param $translator TokenStorageInterface |
||
108 | */ |
||
109 | public function setTranslator(TranslatorInterface $translator) |
||
115 | |||
116 | /** |
||
117 | * setTwig. |
||
118 | * |
||
119 | * @param $twig \Twig_Environment |
||
120 | */ |
||
121 | public function setTwig(\Twig_Environment $twig) |
||
127 | |||
128 | /** |
||
129 | * setRouter. |
||
130 | * |
||
131 | * @param $router Router |
||
132 | */ |
||
133 | public function setRouter(Router $router) |
||
139 | } |
||
140 |