1 | <?php |
||
18 | class FileIteratorReader extends AbstractIteratorReader implements UploadedFileAwareInterface |
||
19 | { |
||
20 | /** @var FileIteratorFactory */ |
||
21 | protected $iteratorFactory; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $iteratorClass; |
||
25 | |||
26 | /** @var array */ |
||
27 | protected $iteratorOptions; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | * |
||
32 | * @Assert\NotBlank(groups={"Execution"}) |
||
33 | * @AssertFile(groups={"Execution"}) |
||
34 | */ |
||
35 | protected $filePath; |
||
36 | |||
37 | /** |
||
38 | * @var boolean |
||
39 | * |
||
40 | * @Assert\Type(type="bool") |
||
41 | * @Assert\IsTrue(groups={"UploadExecution"}) |
||
42 | */ |
||
43 | protected $uploadAllowed = false; |
||
44 | |||
45 | /** |
||
46 | * @param FileIteratorFactory $iteratorFactory |
||
47 | * @param string $iteratorClass |
||
48 | * @param array $iteratorOptions |
||
49 | * @param bool $batchMode |
||
50 | */ |
||
51 | public function __construct( |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getConfigurationFields() |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function getUploadedFileConstraints() |
||
96 | |||
97 | /** |
||
98 | * @param File $uploadedFile |
||
99 | * |
||
100 | * @return FileIteratorReader |
||
101 | */ |
||
102 | public function setUploadedFile(File $uploadedFile) |
||
109 | |||
110 | /** |
||
111 | * @param string $filePath |
||
112 | * |
||
113 | * @return FileIteratorReader |
||
114 | */ |
||
115 | public function setFilePath($filePath) |
||
122 | |||
123 | /** |
||
124 | * @param boolean $uploadAllowed |
||
125 | * |
||
126 | * @return FileIteratorReader |
||
127 | */ |
||
128 | public function setUploadAllowed($uploadAllowed) |
||
134 | |||
135 | /** |
||
136 | * @return boolean $uploadAllowed |
||
137 | */ |
||
138 | public function isUploadAllowed() |
||
142 | |||
143 | /** |
||
144 | * @return string $filePath |
||
145 | */ |
||
146 | public function getFilePath() |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | protected function createIterator() |
||
158 | |||
159 | /** |
||
160 | * @return array |
||
161 | */ |
||
162 | protected function getIteratorOptions() |
||
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | protected function convertNumericIdentifierToString(array $item) |
||
178 | } |
||
179 |