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

getSynchronizationDataTransfersBySspAssetIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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