Passed
Pull Request — master (#13)
by Gordon
01:41
created

Indexer::getFieldsToIndex()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 29
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 29
rs 9.4222
cc 5
nc 5
nop 1
1
<?php declare(strict_types = 1);
2
3
/**
4
 * Created by PhpStorm.
5
 * User: gordon
6
 * Date: 24/3/2561
7
 * Time: 20:36 น.
8
 */
9
10
namespace Suilven\FreeTextSearch\Base;
11
12
use SilverStripe\ORM\DataObject;
13
use Suilven\FreeTextSearch\Indexes;
14
15
abstract class Indexer implements \Suilven\FreeTextSearch\Interfaces\Indexer
16
{
17
    /** @var string */
18
    protected $index;
19
20
    /**
21
     * Index a single data objecct
22
     *
23
     * @param \SilverStripe\ORM\DataObject $dataObject
24
     */
25
    abstract public function index(DataObject $dataObject): void;
26
27
28
    /** @param string $newIndex the new index name */
29
    public function setIndex(string $newIndex): void
30
    {
31
        $this->index = $newIndex;
32
    }
33
34
35
36
}
37