[NFC] Remove some more of the old cvs blocks
[civicrm-core.git] / Civi / Api4 / Action / System / Check.php
CommitLineData
19b53e5b 1<?php
380f3545
TO
2
3/*
4 +--------------------------------------------------------------------+
41498ac5 5 | Copyright CiviCRM LLC. All rights reserved. |
380f3545 6 | |
41498ac5
TO
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
380f3545
TO
10 +--------------------------------------------------------------------+
11 */
12
19b53e5b
C
13namespace Civi\Api4\Action\System;
14
15/**
16 * Retrieve system notices, warnings, errors, etc.
17 */
18class Check extends \Civi\Api4\Generic\BasicGetAction {
19
20 protected function getRecords() {
21 $messages = [];
22 foreach (\CRM_Utils_Check::checkAll() as $message) {
23 $messages[] = $message->toArray();
24 }
25 return $messages;
26 }
27
28 public static function fields() {
29 return [
30 [
31 'name' => 'name',
32 'title' => 'Name',
33 'description' => 'Unique identifier',
34 'data_type' => 'String',
35 ],
36 [
37 'name' => 'title',
38 'title' => 'Title',
39 'description' => 'Short title text',
40 'data_type' => 'String',
41 ],
42 [
43 'name' => 'message',
44 'title' => 'Message',
45 'description' => 'Long description html',
46 'data_type' => 'String',
47 ],
48 [
49 'name' => 'help',
50 'title' => 'Help',
51 'description' => 'Optional extra help (html string)',
52 'data_type' => 'String',
53 ],
54 [
55 'name' => 'icon',
56 'description' => 'crm-i class of icon to display with message',
57 'data_type' => 'String',
58 ],
59 [
60 'name' => 'severity',
61 'title' => 'Severity',
62 'description' => 'Psr\Log\LogLevel string',
63 'data_type' => 'String',
64 'options' => array_combine(\CRM_Utils_Check::getSeverityList(), \CRM_Utils_Check::getSeverityList()),
65 ],
66 [
67 'name' => 'severity_id',
68 'title' => 'Severity ID',
69 'description' => 'Integer representation of Psr\Log\LogLevel',
70 'data_type' => 'Integer',
71 'options' => \CRM_Utils_Check::getSeverityList(),
72 ],
73 [
74 'name' => 'is_visible',
75 'title' => 'is visible',
76 'description' => '0 if message has been hidden by the user',
77 'data_type' => 'Boolean',
78 ],
79 [
80 'name' => 'hidden_until',
81 'title' => 'Hidden until',
82 'description' => 'When will hidden message be visible again?',
83 'data_type' => 'Date',
84 ],
85 [
86 'name' => 'actions',
87 'title' => 'Actions',
88 'description' => 'List of actions user can perform',
89 'data_type' => 'Array',
90 ],
91 ];
92 }
93
94}