1 | <?php |
||
5 | class SearchableField extends DataObject { |
||
6 | private static $db = array( |
||
7 | 'Name' => 'Varchar', // the name of the field, e.g. Title |
||
8 | 'ClazzName' => 'Varchar', // the ClassName this field belongs to |
||
9 | 'Type' => 'Varchar', // the elasticsearch indexing type, |
||
10 | 'ShowHighlights' => 'Boolean', // calculate highlights in Elasticsearch |
||
11 | 'Autocomplete' => 'Boolean', // Use this to check for autocomplete fields, |
||
12 | 'IsInSiteTree' => 'Boolean' // Set to true if this field originates from a SiteTree object |
||
13 | ); |
||
14 | |||
15 | |||
16 | private static $belongs_many_many = array( |
||
|
|||
17 | 'ElasticSearchPages' => 'ElasticSearchPage' |
||
18 | ); |
||
19 | |||
20 | private static $has_one = array('SearchableClass' => 'SearchableClass'); |
||
21 | |||
22 | private static $display_fields = array('Name'); |
||
23 | |||
24 | |||
25 | public function getCMSFields() { |
||
38 | |||
39 | /* |
||
40 | Deletion/inactivity is handled by scripts. Not end user deletable |
||
41 | */ |
||
42 | public function canDelete($member = null) { |
||
45 | |||
46 | /* |
||
47 | Creation is handled by scripts at build time, not end user creatable |
||
48 | */ |
||
49 | public function canCreate($member = null) { |
||
52 | |||
53 | |||
54 | public function HumanReadableSearchable() { |
||
58 | |||
59 | } |
||
60 |
This check marks private properties in classes that are never used. Those properties can be removed.