1 | <?php |
||
2 | namespace EWW\Dpf\Services\Logger; |
||
3 | |||
4 | /* |
||
5 | * This file is part of the TYPO3 CMS project. |
||
6 | * |
||
7 | * It is free software; you can redistribute it and/or modify it under |
||
8 | * the terms of the GNU General Public License, either version 2 |
||
9 | * of the License, or any later version. |
||
10 | * |
||
11 | * For the full copyright and license information, please read the |
||
12 | * LICENSE.txt file that was distributed with this source code. |
||
13 | * |
||
14 | * The TYPO3 project - inspiring people to share! |
||
15 | */ |
||
16 | |||
17 | use TYPO3\CMS\Extbase\Object\ObjectManager; |
||
18 | use EWW\Dpf\Domain\Repository\DocumentTransferLogRepository; |
||
19 | use EWW\Dpf\Domain\Model\DocumentTransferLog; |
||
20 | |||
21 | class TransferLogger |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Logs the response of a document repository transfer |
||
26 | * |
||
27 | * @param |
||
28 | * @return void |
||
29 | */ |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
30 | public static function log($action, $documentUid, $objectIdentifier, $response) |
||
31 | { |
||
32 | |||
33 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
||
34 | $documentTransferLogRepository = $objectManager->get(DocumentTransferLogRepository::class); |
||
35 | |||
36 | $documentTransferLog = $objectManager->get(DocumentTransferLog::class); |
||
37 | $documentTransferLog->setResponse(print_r($response, true)); |
||
38 | $documentTransferLog->setAction($action); |
||
39 | $documentTransferLog->setDocumentUid($documentUid); |
||
40 | $documentTransferLog->setObjectIdentifier($objectIdentifier); |
||
41 | $documentTransferLog->setDate(new \DateTime()); |
||
42 | $documentTransferLogRepository->add($documentTransferLog); |
||
43 | } |
||
44 | |||
45 | } |
||
46 |