Passed
Push — master ( cacbf1...74b6c9 )
by
unknown
34:14
created

SspAssetSearchReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSynchronizationDataTransfersBySspAssetIds() 0 7 1
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace SprykerFeature\Zed\SelfServicePortal\Business\Asset\Reader;
11
12
use Generated\Shared\Transfer\FilterTransfer;
13
use SprykerFeature\Zed\SelfServicePortal\Business\Asset\Mapper\SspAssetSearchMapperInterface;
14
use SprykerFeature\Zed\SelfServicePortal\Persistence\SelfServicePortalRepositoryInterface;
15
16
class SspAssetSearchReader implements SspAssetSearchReaderInterface
17
{
18
    public function __construct(
19
        protected SelfServicePortalRepositoryInterface $repository,
20
        protected SspAssetSearchMapperInterface $sspAssetSearchMapper
21
    ) {
22
    }
23
24
    /**
25
     * @param \Generated\Shared\Transfer\FilterTransfer $filterTransfer
26
     * @param array<int> $sspAssetIds
27
     *
28
     * @return array<\Generated\Shared\Transfer\SynchronizationDataTransfer>
29
     */
30
    public function getSynchronizationDataTransfersBySspAssetIds(
31
        FilterTransfer $filterTransfer,
32
        array $sspAssetIds = []
33
    ): array {
34
        $sspAssetSearchEntities = $this->repository->getSspAssetSearchEntitiesByIds($filterTransfer, $sspAssetIds);
35
36
        return $this->sspAssetSearchMapper->mapSspAssetSearchEntitiesToSynchronizationDataTransfers($sspAssetSearchEntities);
37
    }
38
}
39