OrderReader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getOrderIdByReference() 0 5 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\Heidelpay\Business\Order;
9
10
use SprykerEco\Zed\Heidelpay\Dependency\QueryContainer\HeidelpayToSalesQueryContainerInterface;
11
12
class OrderReader implements OrderReaderInterface
13
{
14
    /**
15
     * @var \SprykerEco\Zed\Heidelpay\Dependency\QueryContainer\HeidelpayToSalesQueryContainerInterface
16
     */
17
    protected $salesQueryContainer;
18
19
    /**
20
     * @param \SprykerEco\Zed\Heidelpay\Dependency\QueryContainer\HeidelpayToSalesQueryContainerInterface $salesQueryContainer
21
     */
22
    public function __construct(HeidelpayToSalesQueryContainerInterface $salesQueryContainer)
23
    {
24
        $this->salesQueryContainer = $salesQueryContainer;
25
    }
26
27
    /**
28
     * @param string $orderReference
29
     *
30
     * @return int
31
     */
32
    public function getOrderIdByReference(string $orderReference): int
33
    {
34
        $orderEntity = $this->salesQueryContainer->getOrderByReference($orderReference);
35
36
        return $orderEntity->getIdSalesOrder();
37
    }
38
}
39