[RSS Feed/News] How to get value of xf_user_profile.custom_fields using finder?

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
How to get value of xf_user_profile.custom_fields using finder?

I currently do this with the following MySQL query:

PHP:

Code:
$custom_fields = $db->fetchOne("
SELECT custom_fields 
FROM xf_user_profile
WHERE user_id = ?
", $userId);

I then get the data with this code:

$customFieldsArray = json_decode($custom_fields, true);

Now when I try to use the finder:

PHP:

Code:
$finder = \XF::finder('XF:UserProfile');
$userProfile = $finder
    ->where('user_id', $userId)
    ->fetchOne();

and try...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom