init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\FullTextSearch\Tests\SolrIndexTest;
4
5
use SilverStripe\FullTextSearch\Solr\SolrIndex;
6
use SilverStripe\FullTextSearch\Tests\SearchUpdaterTest\SearchUpdaterTest_Container;
7
use SilverStripe\FullTextSearch\Tests\SearchUpdaterTest\SearchUpdaterTest_ExtendedContainer;
8
9
class SolrIndexTest_AmbiguousRelationInheritedIndex extends SolrIndex
10
{
11
    protected function getStoredDefault()
12
    {
13
        // Override isDev defaulting to stored
14
        return 'false';
15
    }
16
17
    public function init()
18
    {
19
        $this->addClass(SearchUpdaterTest_Container::class);
20
        // this one has not the relation defined in it's class but is rather inherited from parent
21
        // note that even if we do not include it's parent class the fields will be properly added
22
        $this->addClass(SearchUpdaterTest_ExtendedContainer::class);
23
24
        // These relationships exist on both classes
25
        $this->addFilterField('HasManyObjects.Field1');
26
        $this->addFilterField('ManyManyObjects.Field1');
27
    }
28
}
29