Remove boilerplate code block from APIv4 classes
[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 * @package Civi\Api4
18 */
19 class System extends Generic\AbstractEntity {
20
21 /**
22 * @param bool $checkPermissions
23 * @return Action\System\Flush
24 */
25 public static function flush($checkPermissions = TRUE) {
26 return (new Action\System\Flush(__CLASS__, __FUNCTION__))
27 ->setCheckPermissions($checkPermissions);
28 }
29
30 /**
31 * @param bool $checkPermissions
32 * @return Action\System\Check
33 */
34 public static function check($checkPermissions = TRUE) {
35 return (new Action\System\Check(__CLASS__, __FUNCTION__))
36 ->setCheckPermissions($checkPermissions);
37 }
38
39 /**
40 * @param bool $checkPermissions
41 *
42 * @return Action\System\RotateKey
43 */
44 public static function rotateKey($checkPermissions = TRUE) {
45 return (new Action\System\RotateKey(__CLASS__, __FUNCTION__))
46 ->setCheckPermissions($checkPermissions);
47 }
48
49 /**
50 * @param bool $checkPermissions
51 * @return Generic\BasicGetFieldsAction
52 */
53 public static function getFields($checkPermissions = TRUE) {
54 return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
55 return [];
56 }))->setCheckPermissions($checkPermissions);
57 }
58
59 /**
60 * @param bool $checkPermissions
61 * @return Action\System\ResetPaths
62 */
63 public static function resetPaths($checkPermissions = TRUE) {
64 return (new Action\System\ResetPaths(__CLASS__, __FUNCTION__))
65 ->setCheckPermissions($checkPermissions);
66 }
67
68 }