Total Complexity | 8 |
Total Lines | 80 |
Duplicated Lines | 0 % |
Coverage | 15.38% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class SolrLog extends DataObject |
||
20 | { |
||
21 | private static $table_name = 'SolrLog'; |
||
22 | |||
23 | private static $db = [ |
||
24 | 'Timestamp' => 'Varchar(50)', |
||
25 | 'Message' => 'Text', |
||
26 | 'Index' => 'Varchar(255)', |
||
27 | 'Type' => 'Enum("Config,Index,Query")', |
||
28 | 'Level' => 'Varchar(10)' |
||
29 | ]; |
||
30 | |||
31 | private static $summary_fields = [ |
||
1 ignored issue
–
show
|
|||
32 | 'Timestamp', |
||
33 | 'Index', |
||
34 | 'Type', |
||
35 | 'Level' |
||
36 | ]; |
||
37 | |||
38 | private static $searchable_fields = [ |
||
1 ignored issue
–
show
|
|||
39 | 'Created', |
||
40 | 'Index', |
||
41 | 'Type', |
||
42 | 'Level' |
||
43 | ]; |
||
44 | |||
45 | private static $indexes = [ |
||
1 ignored issue
–
show
|
|||
46 | 'Timestamp' => true, |
||
47 | ]; |
||
48 | |||
49 | private static $sort = 'Created DESC'; |
||
1 ignored issue
–
show
|
|||
50 | |||
51 | /** |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function getLastErrorLine() |
||
55 | { |
||
56 | $lines = explode("\n", $this->Message); |
||
57 | |||
58 | return $lines[0]; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @param null|Member $member |
||
63 | * @return bool|mixed |
||
64 | */ |
||
65 | public function canCreate($member = null, $context = []) |
||
66 | { |
||
67 | return false; |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @param null|Member $member |
||
72 | * @return bool|mixed |
||
73 | */ |
||
74 | public function canEdit($member = null) |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @param null|Member $member |
||
81 | * @return bool|mixed |
||
82 | */ |
||
83 | 26 | public function canView($member = null) |
|
84 | { |
||
85 | 26 | return parent::canView($member); |
|
86 | } |
||
87 | |||
88 | /** |
||
89 | * @param null|Member $member |
||
90 | * @return bool|mixed |
||
91 | */ |
||
92 | public function canDelete($member = null) |
||
99 | } |
||
100 | } |
||
101 |