$removeIndexField = FALSE;
// If index field is not part of the select query, we add it here and remove it below (except for oddball "Setting" api)
- if ($indexField && !empty($params['select']) && is_array($params['select']) && $entity !== 'Setting' && !\Civi\Api4\Utils\SelectUtil::isFieldSelected($indexField, $params['select'])) {
+ if ($indexField && !empty($params['select']) && is_array($params['select']) && !($entity === 'Setting' && $action === 'get') && !\Civi\Api4\Utils\SelectUtil::isFieldSelected($indexField, $params['select'])) {
$params['select'][] = $indexField;
$removeIndexField = TRUE;
}
*
* @throws CiviCRM_API3_Exception
*
- * @return array
+ * @return array|int
+ * Dependant on the $action
*/
function civicrm_api3(string $entity, string $action, array $params = []) {
$params['version'] = 3;
* 'format.is_success' => 1
* will result in a boolean success /fail being returned if that is what you need.
*
- * @param $result
+ * @param mixed $result
*
* @return bool
* true if error, false otherwise