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\CustomValue
;
23 use Civi\Api4\Service\Spec\SpecFormatter
;
26 * Get fields for a custom group.
28 class GetFields
extends \Civi\Api4\Generic\DAOGetFieldsAction
{
29 use \Civi\Api4\Generic\Traits\CustomValueActionTrait
;
31 protected function getRecords() {
32 $fields = $this->_itemsToGet('name');
33 /** @var \Civi\Api4\Service\Spec\SpecGatherer $gatherer */
34 $gatherer = \Civi
::container()->get('spec_gatherer');
35 $spec = $gatherer->getSpec('Custom_' . $this->getCustomGroup(), $this->getAction(), $this->includeCustom
, $this->values
);
36 return SpecFormatter
::specToArray($spec->getFields($fields), $this->loadOptions
);
42 public function getParamInfo($param = NULL) {
43 $info = parent
::getParamInfo($param);
45 // This param is meaningless here.
46 unset($info['includeCustom']);