Merge pull request #20375 from JMAConsulting/core-65
[civicrm-core.git] / Civi / Api4 / System.php
1 <?php
2
3 /*
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
6 | |
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 |
10 +--------------------------------------------------------------------+
11 */
12
13 /**
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 */
18
19 namespace Civi\Api4;
20
21 /**
22 * A collection of system maintenance/diagnostic utilities.
23 *
24 * @searchable none
25 * @package Civi\Api4
26 */
27 class System extends Generic\AbstractEntity {
28
29 /**
30 * @param bool $checkPermissions
31 * @return Action\System\Flush
32 */
33 public static function flush($checkPermissions = TRUE) {
34 return (new Action\System\Flush(__CLASS__, __FUNCTION__))
35 ->setCheckPermissions($checkPermissions);
36 }
37
38 /**
39 * @param bool $checkPermissions
40 * @return Action\System\Check
41 */
42 public static function check($checkPermissions = TRUE) {
43 return (new Action\System\Check(__CLASS__, __FUNCTION__))
44 ->setCheckPermissions($checkPermissions);
45 }
46
47 /**
48 * @param bool $checkPermissions
49 *
50 * @return Action\System\RotateKey
51 */
52 public static function rotateKey($checkPermissions = TRUE) {
53 return (new Action\System\RotateKey(__CLASS__, __FUNCTION__))
54 ->setCheckPermissions($checkPermissions);
55 }
56
57 /**
58 * @param bool $checkPermissions
59 * @return Generic\BasicGetFieldsAction
60 */
61 public static function getFields($checkPermissions = TRUE) {
62 return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
63 return [];
64 }))->setCheckPermissions($checkPermissions);
65 }
66
67 /**
68 * @param bool $checkPermissions
69 * @return Action\System\ResetPaths
70 */
71 public static function resetPaths($checkPermissions = TRUE) {
72 return (new Action\System\ResetPaths(__CLASS__, __FUNCTION__))
73 ->setCheckPermissions($checkPermissions);
74 }
75
76 }