_itemsToGet('name'); /** @var \Civi\Api4\Service\Spec\SpecGatherer $gatherer */ $gatherer = \Civi::container()->get('spec_gatherer'); // Any fields name with a dot in it is custom if ($fields) { $this->includeCustom = strpos(implode('', $fields), '.') !== FALSE; } $spec = $gatherer->getSpec($this->getEntityName(), $this->getAction(), $this->includeCustom, $this->values); return SpecFormatter::specToArray($spec->getFields($fields), $this->loadOptions, $this->values); } public function fields() { $fields = parent::fields(); $fields[] = [ 'name' => 'help_pre', 'data_type' => 'String', ]; $fields[] = [ 'name' => 'help_post', 'data_type' => 'String', ]; $fields[] = [ 'name' => 'custom_field_id', 'data_type' => 'Integer', ]; $fields[] = [ 'name' => 'custom_group_id', 'data_type' => 'Integer', ]; return $fields; } }