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

IndexableResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isProductIndexable() 0 15 2
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