Merge pull request #19221 from civicrm/5.33
[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 * @package Civi\Api4
25 */
26 class System extends Generic\AbstractEntity {
27
28 /**
29 * @param bool $checkPermissions
30 * @return Action\System\Flush
31 */
32 public static function flush($checkPermissions = TRUE) {
33 return (new Action\System\Flush(__CLASS__, __FUNCTION__))
34 ->setCheckPermissions($checkPermissions);
35 }
36
37 /**
38 * @param bool $checkPermissions
39 * @return Action\System\Check
40 */
41 public static function check($checkPermissions = TRUE) {
42 return (new Action\System\Check(__CLASS__, __FUNCTION__))
43 ->setCheckPermissions($checkPermissions);
44 }
45
46 /**
47 * @param bool $checkPermissions
48 * @return Generic\BasicGetFieldsAction
49 */
50 public static function getFields($checkPermissions = TRUE) {
51 return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
52 return [];
53 }))->setCheckPermissions($checkPermissions);
54 }
55
56 }