SchemaFactoryExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 16
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onBeforeFilterFields() 0 8 1
1
<?php
2
/**
3
 * Class SchemaFactoryExtension|Firesphere\SolrPermissions\Extensions\SchemaFactoryExtension Add the member view
4
 * permission field to the schema
5
 *
6
 * @package Firesphere\Solr\Permissions
7
 * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
8
 * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
9
 */
10
11
namespace Firesphere\SolrPermissions\Extensions;
12
13
use Firesphere\SolrSearch\Factories\SchemaFactory;
14
use SilverStripe\Core\Extension;
15
use SilverStripe\ORM\ArrayList;
16
17
/**
18
 * Class \Firesphere\SolrPermissions\Extensions\SchemaFactoryExtension
19
 *
20
 * Extension class to add the default filters for the MemberView
21
 *
22
 * @package Firesphere\Solr\Permissions
23
 * @property SchemaFactory|SchemaFactoryExtension $owner
24
 */
25
class SchemaFactoryExtension extends Extension
26
{
27
28
    /**
29
     * Add the MemberView field to Solr for filtering on members
30
     *
31
     * @param ArrayList $return
32
     */
33 1
    public function onBeforeFilterFields(ArrayList $return)
34
    {
35 1
        $return->push([
36 1
            'Field'       => 'MemberView',
37
            'Type'        => 'string',
38
            'Indexed'     => 'true',
39
            'Stored'      => 'true',
40
            'MultiValued' => 'true',
41
        ]);
42 1
    }
43
}
44