[NFC] Remove some more of the old cvs blocks
[civicrm-core.git] / Civi / Api4 / Action / Setting / GetFields.php
CommitLineData
19b53e5b 1<?php
380f3545
TO
2
3/*
4 +--------------------------------------------------------------------+
41498ac5 5 | Copyright CiviCRM LLC. All rights reserved. |
380f3545 6 | |
41498ac5
TO
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 |
380f3545
TO
10 +--------------------------------------------------------------------+
11 */
12
19b53e5b
C
13namespace Civi\Api4\Action\Setting;
14
15/**
16 * Get information about CiviCRM settings.
17 *
18 * @method int getDomainId
19 * @method $this setDomainId(int $domainId)
20 */
21class GetFields extends \Civi\Api4\Generic\BasicGetFieldsAction {
22
23 /**
24 * Domain id of settings. Leave NULL for default domain.
25 *
26 * @var int
27 */
28 protected $domainId;
29
30 protected function getRecords() {
31 // TODO: Waiting for filter handling to get fixed in core
32 // $names = $this->_itemsToGet('name');
33 // $filter = $names ? ['name' => $names] : [];
34 $filter = [];
35 return \Civi\Core\SettingsMetadata::getMetadata($filter, $this->domainId, $this->loadOptions);
36 }
37
38 public function fields() {
39 return [
40 [
41 'name' => 'name',
42 'data_type' => 'String',
43 ],
44 [
45 'name' => 'title',
46 'data_type' => 'String',
47 ],
48 [
49 'name' => 'description',
50 'data_type' => 'String',
51 ],
52 [
53 'name' => 'help_text',
54 'data_type' => 'String',
55 ],
56 [
57 'name' => 'default',
58 'data_type' => 'String',
59 ],
60 [
61 'name' => 'pseudoconstant',
62 'data_type' => 'String',
63 ],
64 [
65 'name' => 'options',
66 'data_type' => 'Array',
67 ],
68 [
69 'name' => 'group_name',
70 'data_type' => 'String',
71 ],
72 [
73 'name' => 'group',
74 'data_type' => 'String',
75 ],
76 [
77 'name' => 'html_type',
78 'data_type' => 'String',
79 ],
80 [
81 'name' => 'add',
82 'data_type' => 'String',
83 ],
84 [
85 'name' => 'serialize',
86 'data_type' => 'Integer',
87 ],
88 [
89 'name' => 'data_type',
90 'data_type' => 'Integer',
91 ],
92 ];
93 }
94
95}