+--------------------------------------------------------------------+
*/
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- */
-
-
namespace Civi\Api4\Generic;
use Civi\API\Exception\NotImplementedException;
$fields = $this->entityFields();
foreach ($records as &$values) {
foreach ($this->entityFields() as $field) {
+ $values += [$field['name'] => NULL];
if (!empty($field['options'])) {
foreach (FormattingUtil::$pseudoConstantSuffixes as $suffix) {
$pseudofield = $field['name'] . ':' . $suffix;
if (!isset($values[$pseudofield]) && isset($values[$field['name']]) && $this->_isFieldSelected($pseudofield)) {
$values[$pseudofield] = $values[$field['name']];
- $fields[$pseudofield] = $field;
}
}
}
}
}
// Swap raw values with pseudoconstants
- FormattingUtil::formatOutputValues($records, $fields, $this->getEntityName(), $this->getActionName());
+ FormattingUtil::formatOutputValues($records, $fields, $this->getActionName());
}
}