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