1 | <?php |
||
29 | class SuffixNumberUploadFileHandler |
||
30 | { |
||
31 | /** |
||
32 | * The file factory. |
||
33 | * |
||
34 | * @var FileFactory |
||
35 | */ |
||
36 | private $factory; |
||
37 | |||
38 | /** |
||
39 | * The filesystem. |
||
40 | * |
||
41 | * @var Filesystem |
||
42 | */ |
||
43 | private $filesystem; |
||
44 | |||
45 | /** |
||
46 | * The file repository. |
||
47 | * |
||
48 | * @var FileRepository |
||
49 | */ |
||
50 | private $repository; |
||
51 | |||
52 | /** |
||
53 | * The specification factory. |
||
54 | * |
||
55 | * @var FileSpecificationFactory |
||
56 | */ |
||
57 | private $specificationFactory; |
||
58 | |||
59 | /** |
||
60 | * Constructor. |
||
61 | * |
||
62 | * @param Filesystem $filesystem The filesystem |
||
63 | * @param FileRepository $aRepository The file repository |
||
64 | * @param FileSpecificationFactory $aSpecificationFactory The file specification factory |
||
65 | * @param FileFactory $aFactory The file factory |
||
66 | */ |
||
67 | public function __construct( |
||
78 | |||
79 | /** |
||
80 | * Handles the given command. |
||
81 | * |
||
82 | * @param SuffixNumberUploadFileCommand $aCommand The command |
||
83 | * |
||
84 | * @throws FileAlreadyExistsException when file is already exists |
||
85 | */ |
||
86 | public function __invoke(SuffixNumberUploadFileCommand $aCommand) |
||
103 | |||
104 | private function checkFileExists(FileId $id) |
||
111 | |||
112 | private function buildName(FileName $fileName) |
||
128 | } |
||
129 |