SearchAdmin::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * class SearchAdmin|Firesphere\SolrSearch\Admins\SearchAdmin Base admin for Synonyms, logs and dirty classes
4
 *
5
 * @package Firesphere\Solr\Search
6
 * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
7
 * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
8
 */
9
10
namespace Firesphere\SolrSearch\Admins;
11
12
use Firesphere\SolrSearch\Models\DirtyClass;
13
use Firesphere\SolrSearch\Models\SearchSynonym;
14
use Firesphere\SolrSearch\Models\SolrLog;
15
use SilverStripe\Admin\ModelAdmin;
16
use SilverStripe\View\Requirements;
17
18
/**
19
 * Class \Firesphere\SolrSearch\Admins\SearchAdmin
20
 * Manage or see the Solr configuration. Default implementation of SilverStripe ModelAdmin
21
 * Nothing to see here
22
 *
23
 * @package Firesphere\Solr\Search
24
 */
25
class SearchAdmin extends ModelAdmin
26
{
27
    /**
28
     * @var array Models managed by this admin
29
     */
30
    private static $managed_models = [
31
        SearchSynonym::class,
32
        SolrLog::class,
33
        DirtyClass::class,
34
    ];
35
36
    /**
37
     * @var string Add a pretty magnifying glass to the sidebar menu
38
     */
39
    private static $menu_icon_class = 'font-icon-search';
40
41
    /**
42
     * @var string Where to find me
43
     */
44
    private static $url_segment = 'searchadmin';
45
46
    /**
47
     * @var string My name
48
     */
49
    private static $menu_title = 'Search';
50
51
    /**
52
     * Make sure the custom CSS for highlighting in the GridField is loaded
53
     */
54 1
    public function init()
55
    {
56 1
        parent::init();
57
58 1
        Requirements::css('firesphere/solr-search:client/dist/main.css');
59 1
    }
60
}
61