1 | <?php |
||
24 | class LogEntry extends DataObject implements PermissionProvider |
||
25 | { |
||
26 | /** |
||
27 | * {@inheritDoc} |
||
28 | */ |
||
29 | private static $table_name = 'LogEntry'; |
||
30 | |||
31 | |||
32 | /** |
||
33 | * @var bool |
||
34 | */ |
||
35 | private static $format_entry = true; |
||
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | private static $db = [ |
||
41 | 'Entry' => 'Text', |
||
42 | 'Level' => 'Varchar' |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | private static $summary_fields = [ |
||
49 | 'GridfieldSummary' => 'Entry', |
||
50 | 'Created' => 'Created', |
||
51 | 'Level' => 'Level' |
||
52 | ]; |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | * @return \SilverStripe\Forms\FieldList |
||
57 | */ |
||
58 | public function getCMSFields() |
||
76 | |||
77 | private function buildEntry() |
||
94 | |||
95 | /** |
||
96 | * @param int $length Length of the summary |
||
97 | * @return string shortened string of the entry if too long. |
||
98 | */ |
||
99 | public function getGridfieldSummary($length = 300) |
||
105 | |||
106 | /** |
||
107 | * Permissions |
||
108 | */ |
||
109 | public function providePermissions() |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function canCreate($member = null, $context = []) |
||
132 | |||
133 | /** |
||
134 | * We should never edit log entries |
||
135 | * |
||
136 | * {@inheritDoc} |
||
137 | */ |
||
138 | public function canEdit($member = null) |
||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function canDelete($member = null) |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function canView($member = null) |
||
157 | |||
158 | } |
||
159 |