1 | <?php |
||
22 | class LogEntry extends DataObject |
||
23 | { |
||
24 | /** |
||
25 | * {@inheritDoc} |
||
26 | */ |
||
27 | private static $table_name = 'LogEntry'; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | private static $format_entry = true; |
||
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | private static $db = [ |
||
39 | 'Entry' => 'Text', |
||
40 | 'Level' => 'Varchar' |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * {@inheritDoc} |
||
45 | */ |
||
46 | private static $summary_fields = [ |
||
47 | 'GridfieldSummary' => 'Entry', |
||
48 | 'Created' => 'Created', |
||
49 | 'Level' => 'Level' |
||
50 | ]; |
||
51 | |||
52 | /** |
||
53 | * We should never need to edit log entries |
||
54 | * |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | public function canEdit($member = false, $context = []) |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | * @return \SilverStripe\Forms\FieldList |
||
65 | */ |
||
66 | public function getCMSFields() |
||
84 | |||
85 | private function buildEntry() |
||
102 | |||
103 | /** |
||
104 | * @param int $length Length of the summary |
||
105 | * @return string shortened string of the entry if too long. |
||
106 | */ |
||
107 | public function getGridfieldSummary($length = 300) |
||
113 | } |
||
114 |