Failed Conditions
Push — master ( ae631c...a04781 )
by
unknown
52:50 queued 12:37
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
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
namespace Spryker\Zed\ProductLabelSearch\Dependency\Facade;
9
10
class ProductLabelSearchToProductPageSearchAdapter implements ProductLabelSearchToProductPageSearchInterface
11
{
12
    /**
13
     * @var \Spryker\Zed\ProductPageSearch\Business\ProductPageSearchFacadeInterface
14
     */
15
    protected $productPageSearchFacade;
16
17
    /**
18
     * @param \Spryker\Zed\ProductPageSearch\Business\ProductPageSearchFacadeInterface $productPageSearchFacade
19
     */
20
    public function __construct($productPageSearchFacade)
21
    {
22
        $this->productPageSearchFacade = $productPageSearchFacade;
23
    }
24
25
    /**
26
     * @param array<int, int> $productAbstractIdTimestampMap
27
     *
28
     * @return void
29
     */
30
    public function publishWithTimestamp(array $productAbstractIdTimestampMap): void
31
    {
32
        if (!method_exists($this->productPageSearchFacade, 'publishWithTimestamp') === false) {
33
            $this->productPageSearchFacade->refresh(array_keys($productAbstractIdTimestampMap));
34
        }
35
36
        $this->productPageSearchFacade->publishWithTimestamp($productAbstractIdTimestampMap);
37
    }
38
}
39