saveEasycreditOrderIdentifier()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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;
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
use Spryker\Zed\Kernel\Persistence\AbstractEntityManager;
15
16
/**
17
 * @method \SprykerEco\Zed\Easycredit\Persistence\EasycreditPersistenceFactory getFactory()
18
 *
19
 * @SuppressWarnings(PHPMD)
20
 */
21
class EasycreditEntityManager extends AbstractEntityManager implements EasycreditEntityManagerInterface
22
{
23
    /**
24
     * @param \Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer $apiLogTransfer
25
     *
26
     * @return \Generated\Shared\Transfer\PaymentEasycreditApiLogTransfer
27
     */
28
    public function saveEasycreditApiLog(PaymentEasycreditApiLogTransfer $apiLogTransfer): PaymentEasycreditApiLogTransfer
29
    {
30
        $easycreditApiLog = $this->getFactory()
31
            ->createEasycreditPersistenceMapper()
32
            ->mapPaymentEasycreditApiLogTransferToEntity($apiLogTransfer, new SpyPaymentEasycreditApiLog());
33
34
        $easycreditApiLog->save();
35
36
        return $this->getFactory()
37
            ->createEasycreditPersistenceMapper()
38
            ->mapEntityToPaymentEasycreditApiLogTransfer($easycreditApiLog, $apiLogTransfer);
39
    }
40
41
    /**
42
     * @param \Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer
43
     *
44
     * @return \Generated\Shared\Transfer\PaymentEasycreditOrderIdentifierTransfer
45
     */
46
    public function saveEasycreditOrderIdentifier(PaymentEasycreditOrderIdentifierTransfer $paymentEasycreditOrderIdentifierTransfer): PaymentEasycreditOrderIdentifierTransfer
47
    {
48
        $easycreditOrderIdentifier = $this->getFactory()
49
            ->createEasycreditPersistenceMapper()
50
            ->mapEasycreditOrderIdentifierTransferToEntity($paymentEasycreditOrderIdentifierTransfer, new SpyPaymentEasycreditOrderIdentifier());
51
52
        $easycreditOrderIdentifier->save();
53
54
        return $this->getFactory()
55
            ->createEasycreditPersistenceMapper()
56
            ->mapEntityToSpyPaymentEasycreditOrderIdentifierTransfer($easycreditOrderIdentifier, $paymentEasycreditOrderIdentifierTransfer);
57
    }
58
}
59