Merge pull request #22203 from colemanw/revertContactDeletePermission
[civicrm-core.git] / Civi / Api4 / System.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11 namespace Civi\Api4;
12
13 /**
14 * A collection of system maintenance/diagnostic utilities.
15 *
16 * @searchable none
17 * @since 5.19
18 * @package Civi\Api4
19 */
20 class System extends Generic\AbstractEntity {
21
22 /**
23 * @param bool $checkPermissions
24 * @return Action\System\Flush
25 */
26 public static function flush($checkPermissions = TRUE) {
27 return (new Action\System\Flush(__CLASS__, __FUNCTION__))
28 ->setCheckPermissions($checkPermissions);
29 }
30
31 /**
32 * @param bool $checkPermissions
33 * @return Action\System\Check
34 */
35 public static function check($checkPermissions = TRUE) {
36 return (new Action\System\Check(__CLASS__, __FUNCTION__))
37 ->setCheckPermissions($checkPermissions);
38 }
39
40 /**
41 * @param bool $checkPermissions
42 *
43 * @return Action\System\RotateKey
44 */
45 public static function rotateKey($checkPermissions = TRUE) {
46 return (new Action\System\RotateKey(__CLASS__, __FUNCTION__))
47 ->setCheckPermissions($checkPermissions);
48 }
49
50 /**
51 * @param bool $checkPermissions
52 * @return Generic\BasicGetFieldsAction
53 */
54 public static function getFields($checkPermissions = TRUE) {
55 return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
56 return [];
57 }))->setCheckPermissions($checkPermissions);
58 }
59
60 /**
61 * @param bool $checkPermissions
62 * @return Action\System\ResetPaths
63 */
64 public static function resetPaths($checkPermissions = TRUE) {
65 return (new Action\System\ResetPaths(__CLASS__, __FUNCTION__))
66 ->setCheckPermissions($checkPermissions);
67 }
68
69 }