Remove use of ignoreException() from SMTP settings form.
[civicrm-core.git] / Civi / Api4 / System.php
index 5dbe24c510f66bfd64696075743e87e43c4c3578..0afefe11a1a51233c257ba54fac40cf72d6fc703 100644 (file)
  * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 
-
 namespace Civi\Api4;
 
-use Civi\Api4\Generic\BasicGetFieldsAction;
-
 /**
  * A collection of system maintenance/diagnostic utilities.
  *
@@ -28,18 +25,42 @@ use Civi\Api4\Generic\BasicGetFieldsAction;
  */
 class System extends Generic\AbstractEntity {
 
-  public static function flush() {
-    return new Action\System\Flush(__CLASS__, __FUNCTION__);
+  /**
+   * @param bool $checkPermissions
+   * @return Action\System\Flush
+   */
+  public static function flush($checkPermissions = TRUE) {
+    return (new Action\System\Flush(__CLASS__, __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
+  }
+
+  /**
+   * @param bool $checkPermissions
+   * @return Action\System\Check
+   */
+  public static function check($checkPermissions = TRUE) {
+    return (new Action\System\Check(__CLASS__, __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
   }
 
-  public static function check() {
-    return new Action\System\Check(__CLASS__, __FUNCTION__);
+  /**
+   * @param bool $checkPermissions
+   *
+   * @return Action\System\RotateKey
+   */
+  public static function rotateKey($checkPermissions = TRUE) {
+    return (new Action\System\RotateKey(__CLASS__, __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
   }
 
-  public static function getFields() {
-    return new BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
+  /**
+   * @param bool $checkPermissions
+   * @return Generic\BasicGetFieldsAction
+   */
+  public static function getFields($checkPermissions = TRUE) {
+    return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
       return [];
-    });
+    }))->setCheckPermissions($checkPermissions);
   }
 
 }