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