JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
if ($cspUserId == ''){
///deprecated|J3!|$cspUserId = JFactory::getUser();
$cspUserId = Joomla\CMS\Factory::getApplication()->getIdentity()->id; //J4!
}
$customFields = FieldsHelper::getFields('com_users.user', $cspUserId, true);
foreach ($customFields as $customField) {
$cspReturn[$customField->title] = $customField->value;
}
[/code]
However, now when I view the array of objects from FieldsHelper::getFields, the property 'value' is not present. I need to read the values from users custom fields in my component. Are they accessible with another class or method? If so, can someone point me the way? I'd prefer to use the Joomla API, but if needed, I could read directly from the database.
Thanks!