Passed
Push — master ( 6acaa5...4ef58e )
by Simon
06:26
created

SchemaServiceExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A onBeforeFilterFields() 0 8 1
1
<?php
2
3
4
namespace Firesphere\SolrPermissions\Extensions;
5
6
7
use Firesphere\SolrSearch\Services\SchemaService;
8
use SilverStripe\Core\Extension;
9
use SilverStripe\ORM\ArrayList;
10
11
/**
12
 * Class \Firesphere\SolrPermissions\Extensions\SchemaServiceExtension
13
 *
14
 * Extension class to add the default filters for the MemberView
15
 *
16
 * @property SchemaService|SchemaServiceExtension $owner
17
 */
18
class SchemaServiceExtension extends Extension
19
{
20
21
    /**
22
     * Add the MemberView field to Solr for filtering on members
23
     *
24
     * @param ArrayList $return
25
     */
26
    public function onBeforeFilterFields(ArrayList $return)
27
    {
28
        $return->push([
29
            'Field'       => 'MemberView',
30
            'Type'        => 'string',
31
            'Indexed'     => 'true',
32
            'Stored'      => 'true',
33
            'MultiValued' => 'true',
34
        ]);
35
    }
36
}
37