OrderReader::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 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\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