4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 namespace Civi\Api4\Action\Setting
;
23 use Civi\Api4\Generic\Result
;
26 * Get the value of one or more CiviCRM settings.
28 * @method array getSelect
29 * @method $this addSelect(string $name)
30 * @method $this setSelect(array $select)
32 class Get
extends AbstractSettingAction
{
35 * Names of settings to retrieve
39 protected $select = [];
42 * @param \Civi\Api4\Generic\Result $result
43 * @param \Civi\Core\SettingsBag $settingsBag
48 protected function processSettings(Result
$result, $settingsBag, $meta, $domain) {
50 foreach ($this->select
as $name) {
53 'value' => $settingsBag->get($name),
54 'domain_id' => $domain,
59 foreach ($settingsBag->all() as $name => $value) {
63 'domain_id' => $domain,
67 foreach ($result as $name => &$setting) {
68 if (isset($setting['value']) && !empty($meta[$name]['serialize'])) {
69 $setting['value'] = \CRM_Core_DAO
::unSerializeField($setting['value'], $meta[$name]['serialize']);