Passed
Pull Request — master (#18)
by Volodymyr
11:32 queued 03:05
created

AfterPayEntityManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A addCustomerNumberToAfterPayPaymentByIdSalesOrder() 0 9 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\AfterPay\Persistence;
9
10
use Spryker\Zed\Kernel\Persistence\AbstractEntityManager;
11
12
/**
13
 * @method \SprykerEco\Zed\AfterPay\Persistence\AfterPayPersistenceFactory getFactory()
14
 */
15
class AfterPayEntityManager extends AbstractEntityManager implements AfterPayEntityManagerInterface
16
{
17
    /**
18
     * @param string $customerNumber
19
     * @param int $idSalesOrder
20
     *
21
     * @return void
22
     */
23
    public function addCustomerNumberToAfterPayPaymentByIdSalesOrder(string $customerNumber, int $idSalesOrder): void
24
    {
25
        $paymentEntity = $this->getFactory()
26
            ->createPaymentAfterPayQuery()
27
            ->findOneByFkSalesOrder($idSalesOrder);
28
29
        if ($paymentEntity) {
30
            $paymentEntity->setInfoscoreCustomerNumber($customerNumber);
31
            $paymentEntity->save();
32
        }
33
    }
34
}
35