Passed
Push — hans/cow-is-animal ( cb2f8e...10edfb )
by Simon
06:23 queued 03:17
created

SearchSynonym::getCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 12
ccs 7
cts 7
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
4
namespace Firesphere\SolrSearch\Models;
5
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\ORM\DataObject;
8
9
/**
10
 * Class \Firesphere\SolrSearch\Models\SearchSynonym
11
 *
12
 * @property string $Keyword
13
 * @property string $Synonym
14
 */
15
class SearchSynonym extends DataObject
16
{
17
    /**
18
     * @var string Table name
19
     */
20
    private static $table_name = 'SearchSynonym';
21
22
    /**
23
     * @var string Singular name
24
     */
25
    private static $singular_name = 'Search synonym';
1 ignored issue
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
26
27
    /**
28
     * @var string Plural name
29
     */
30
    private static $plural_name = 'Search synonyms';
1 ignored issue
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
31
32
    /**
33
     * @var array DB Fields
34
     */
35
    private static $db = [
36
        'Keyword' => 'Varchar(255)',
37
        'Synonym' => 'Text'
38
    ];
39
40
    /**
41
     * @var array Summary fields
42
     */
43
    private static $summary_fields = [
1 ignored issue
show
introduced by
The private property $summary_fields is not used, and could be removed.
Loading history...
44
        'Keyword',
45
        'Synonym'
46
    ];
47
48
    /**
49
     * Get the required CMS Fields for this synonym
50
     *
51
     * @return FieldList
52
     */
53 1
    public function getCMSFields()
54
    {
55 1
        $fields = parent::getCMSFields();
56
57 1
        $fields->dataFieldByName('Synonym')->setDescription(
58 1
            _t(
59 1
                __CLASS__ . '.SYNONYM',
60 1
                'Create synonyms for a given keyword, add as many synonyms comma separated.'
61
            )
62
        );
63
64 1
        return $fields;
65
    }
66
}
67