Merge pull request #22068 from colemanw/managedTypes
[civicrm-core.git] / Civi / Api4 / Setting.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 * CiviCRM settings api.
15 *
16 * Used to read/write persistent setting data from CiviCRM.
17 *
18 * @see \Civi\Core\SettingsBag
19 * @searchable none
20 * @since 5.19
21 * @package Civi\Api4
22 */
23 class Setting extends Generic\AbstractEntity {
24
25 /**
26 * @param bool $checkPermissions
27 * @return Action\Setting\Get
28 */
29 public static function get($checkPermissions = TRUE) {
30 return (new Action\Setting\Get(__CLASS__, __FUNCTION__))
31 ->setCheckPermissions($checkPermissions);
32 }
33
34 /**
35 * @param bool $checkPermissions
36 * @return Action\Setting\Set
37 */
38 public static function set($checkPermissions = TRUE) {
39 return (new Action\Setting\Set(__CLASS__, __FUNCTION__))
40 ->setCheckPermissions($checkPermissions);
41 }
42
43 /**
44 * @param bool $checkPermissions
45 * @return Action\Setting\Revert
46 */
47 public static function revert($checkPermissions = TRUE) {
48 return (new Action\Setting\Revert(__CLASS__, __FUNCTION__))
49 ->setCheckPermissions($checkPermissions);
50 }
51
52 /**
53 * @param bool $checkPermissions
54 * @return Action\Setting\GetFields
55 */
56 public static function getFields($checkPermissions = TRUE) {
57 return (new Action\Setting\GetFields(__CLASS__, __FUNCTION__))
58 ->setCheckPermissions($checkPermissions);
59 }
60
61 }