Completed
Pull Request — master (#85)
by
unknown
04:48
created

IndexableResolver::isProductIndexable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 15
rs 10
1
<?php
2
/**
3
 * @author Peter Ukena <[email protected]>
4
 */
5
6
declare(strict_types=1);
7
8
namespace BitBag\SyliusElasticsearchPlugin\Resolver;
9
10
use Sylius\Component\Core\Model\ProductInterface;
11
12
class IndexableResolver implements IndexableInterface
13
{
14
    /** {@inheritdoc} */
15
    public function isProductIndexable(ProductInterface $product): bool
16
    {
17
        // Check if product is enabled at all.
18
        if (!$product->isEnabled()) {
19
            return false;
20
        }
21
22
        /**
23
         * We can check things like
24
         *   * Stock
25
         *   * Channel
26
         *   * ...
27
         */
28
29
        return true;
30
    }
31
}
32