Merge pull request #15838 from demeritcowboy/getcasereport-split
[civicrm-core.git] / Civi / Api4 / Action / Setting / GetFields.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 * $Id$
18 *
19 */
20
21 namespace Civi\Api4\Action\Setting;
22
23 /**
24 * Get information about CiviCRM settings.
25 *
26 * @method int getDomainId
27 * @method $this setDomainId(int $domainId)
28 */
29 class GetFields extends \Civi\Api4\Generic\BasicGetFieldsAction {
30
31 /**
32 * Domain id of settings. Leave NULL for default domain.
33 *
34 * @var int
35 */
36 protected $domainId;
37
38 protected function getRecords() {
39 // TODO: Waiting for filter handling to get fixed in core
40 // $names = $this->_itemsToGet('name');
41 // $filter = $names ? ['name' => $names] : [];
42 $filter = [];
43 return \Civi\Core\SettingsMetadata::getMetadata($filter, $this->domainId, $this->loadOptions);
44 }
45
46 public function fields() {
47 return [
48 [
49 'name' => 'name',
50 'data_type' => 'String',
51 ],
52 [
53 'name' => 'title',
54 'data_type' => 'String',
55 ],
56 [
57 'name' => 'description',
58 'data_type' => 'String',
59 ],
60 [
61 'name' => 'help_text',
62 'data_type' => 'String',
63 ],
64 [
65 'name' => 'default',
66 'data_type' => 'String',
67 ],
68 [
69 'name' => 'pseudoconstant',
70 'data_type' => 'String',
71 ],
72 [
73 'name' => 'options',
74 'data_type' => 'Array',
75 ],
76 [
77 'name' => 'group_name',
78 'data_type' => 'String',
79 ],
80 [
81 'name' => 'group',
82 'data_type' => 'String',
83 ],
84 [
85 'name' => 'html_type',
86 'data_type' => 'String',
87 ],
88 [
89 'name' => 'add',
90 'data_type' => 'String',
91 ],
92 [
93 'name' => 'serialize',
94 'data_type' => 'Integer',
95 ],
96 [
97 'name' => 'data_type',
98 'data_type' => 'Integer',
99 ],
100 ];
101 }
102
103 }