1 | <?php |
||
19 | class LogEntry extends DataObject |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | private static $table_name = 'LogEntry'; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private static $format_entry = true; |
||
31 | |||
32 | /** |
||
33 | * {@inheritDoc} |
||
34 | */ |
||
35 | private static $db = [ |
||
36 | 'Entry' => 'Text', |
||
37 | 'Level' => 'Varchar' |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * {@inheritDoc} |
||
42 | */ |
||
43 | private static $summary_fields = [ |
||
44 | 'GridfieldSummary' => 'Entry', |
||
45 | 'Created' => 'Created', |
||
46 | 'Level' => 'Level' |
||
47 | ]; |
||
48 | |||
49 | /** |
||
50 | * We should never need to edit log entries |
||
51 | * |
||
52 | * {@inheritDoc} |
||
53 | */ |
||
54 | public function canEdit($member = false, $context = []) |
||
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | * @return \SilverStripe\Forms\FieldList |
||
62 | */ |
||
63 | public function getCMSFields() |
||
88 | |||
89 | /** |
||
90 | * Recursive method, will call itself if a sub element is an array |
||
91 | * @param array $data |
||
92 | * @param bool $first start with an opening bracket? if true, skip (counterintuitive, but naming) |
||
93 | * @return string formatted <ul><li> of the array; |
||
94 | */ |
||
95 | private function entryToUl($data, $first = false) |
||
111 | |||
112 | /** |
||
113 | * @param string $text |
||
114 | * @return string |
||
115 | * @deprecated This method exists to make sure non-JSONFormatted messages won't break the flow |
||
116 | */ |
||
117 | private function formatLegacyEntry($text) |
||
145 | |||
146 | /** |
||
147 | * @param int $length Length of the summary |
||
148 | * @return string shortened string of the entry if too long. |
||
149 | */ |
||
150 | public function getGridfieldSummary($length = 300) |
||
156 | } |
||
157 |