SolrIndexTest_AmbiguousRelationInheritedIndex   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getStoredDefault() 0 4 1
A init() 0 10 1
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