1 | <?php |
||
26 | class ActivityLogController extends FOSRestController implements ClassResourceInterface |
||
27 | { |
||
28 | const EXPORT_COLUMN_DELIMITER = ';'; |
||
29 | const EXPORT_FILENAME = 'activity-log-export'; |
||
30 | |||
31 | /** |
||
32 | * Returns all fields that can be used by list. |
||
33 | * |
||
34 | * @Get("activity-log/fields") |
||
35 | * |
||
36 | * @param Request $request |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function getFieldsAction(Request $request) |
||
|
|||
41 | { |
||
42 | // default contacts list |
||
43 | return $this->handleView( |
||
44 | $this->view( |
||
45 | array_values( |
||
46 | $this->getFieldDescriptors() |
||
47 | ), |
||
48 | 200 |
||
49 | ) |
||
50 | ); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Shows all activity-log-items. |
||
55 | * |
||
56 | * @param Request $request |
||
57 | * |
||
58 | * @Get("activity-log") |
||
59 | * |
||
60 | * @return \Symfony\Component\HttpFoundation\Response |
||
61 | */ |
||
62 | 5 | public function cgetAction(Request $request) |
|
63 | { |
||
64 | 5 | $list = $this->getActivityLogs($request); |
|
65 | |||
66 | 5 | $view = $this->view($list, 200); |
|
67 | |||
68 | 5 | return $this->handleView($view); |
|
69 | } |
||
70 | |||
71 | /** |
||
72 | * Create field-descriptor array. |
||
73 | * |
||
74 | * @return FieldDescriptor[] |
||
75 | */ |
||
76 | protected function getFieldDescriptors() |
||
77 | { |
||
78 | return [ |
||
79 | 'uuid' => new FieldDescriptor('id', 'public.id', true, false), |
||
80 | 'data' => new FieldDescriptor('data', 'public.data', false, true), |
||
81 | ]; |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * returns view of files. |
||
86 | * |
||
87 | * @param Request $request |
||
88 | * |
||
89 | * @throws EntityNotFoundException |
||
90 | * |
||
91 | * @return ListRepresentation |
||
92 | */ |
||
93 | 5 | protected function getActivityLogs(Request $request) |
|
132 | } |
||
133 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.