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

addCustomerNumberToAfterPayPaymentByIdSalesOrder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
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