mapEntityToSpyPaymentEasycreditOrderIdentifierTransfer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Easycredit\Persistence\Mapper;
9
10
use Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...asycreditApiLogTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...OrderIdentifierTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditApiLog;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Easycredit\Persi...PaymentEasycreditApiLog was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditOrderIdentifier;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Easycredit\Persi...sycreditOrderIdentifier was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
class EasycreditPersistenceMapper implements EasycreditPersistenceMapperInterface
16
{
17
    /**
18
     * @param \Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer $easycreditApiLogTransfer
19
     * @param \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditApiLog $paymentEasycreditApiLogEntity
20
     *
21
     * @return \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditApiLog
22
     */
23
    public function mapPaymentEasycreditApiLogTransferToEntity(
24
        PaymentEasycreditApiLogTransfer $easycreditApiLogTransfer,
25
        SpyPaymentEasycreditApiLog $paymentEasycreditApiLogEntity
26
    ): SpyPaymentEasycreditApiLog {
27
        $paymentEasycreditApiLogEntity->fromArray($easycreditApiLogTransfer->modifiedToArray());
28
        $paymentEasycreditApiLogEntity->setNew($easycreditApiLogTransfer->getIdPaymentEasycreditApiLog() === null);
29
30
        return $paymentEasycreditApiLogEntity;
31
    }
32
33
    /**
34
     * @param \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditApiLog $paymentEasycreditApiLogEntity
35
     * @param \Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer $easycreditApiLogTransfer
36
     *
37
     * @return \Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer
38
     */
39
    public function mapEntityToPaymentEasycreditApiLogTransfer(
40
        SpyPaymentEasycreditApiLog $paymentEasycreditApiLogEntity,
41
        PaymentEasycreditApiLogTransfer $easycreditApiLogTransfer
42
    ): PaymentEasycreditApiLogTransfer {
43
        return $easycreditApiLogTransfer->fromArray($paymentEasycreditApiLogEntity->toArray(), true);
44
    }
45
46
    /**
47
     * @param \Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer
48
     * @param \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditOrderIdentifier $paymentEasycreditOrderIdentifierEntity
49
     *
50
     * @return \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditOrderIdentifier
51
     */
52
    public function mapEasycreditOrderIdentifierTransferToEntity(
53
        PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer,
54
        SpyPaymentEasycreditOrderIdentifier $paymentEasycreditOrderIdentifierEntity
55
    ): SpyPaymentEasycreditOrderIdentifier {
56
        $paymentEasycreditOrderIdentifierEntity->fromArray($paymentEasycreditOrderIdentifierTransfer->modifiedToArray());
57
        $paymentEasycreditOrderIdentifierEntity->setNew($paymentEasycreditOrderIdentifierTransfer->getIdPaymentEasycreditOrderIdentifier() === null);
58
59
        return $paymentEasycreditOrderIdentifierEntity;
60
    }
61
62
    /**
63
     * @param \Orm\Zed\Easycredit\Persistence\SpyPaymentEasycreditOrderIdentifier $paymentEasycreditOrderIdentifierEntity
64
     * @param \Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer
65
     *
66
     * @return \Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer
67
     */
68
    public function mapEntityToSpyPaymentEasycreditOrderIdentifierTransfer(
69
        SpyPaymentEasycreditOrderIdentifier $paymentEasycreditOrderIdentifierEntity,
70
        PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer
71
    ): PaymentEasycreditOrderIdentifierTransfer {
72
        return $paymentEasycreditOrderIdentifierTransfer->fromArray($paymentEasycreditOrderIdentifierEntity->toArray(), true);
73
    }
74
}
75