Do we have example on how to get a user by a custom field?
In the docs, we can get a user by ossn_user_by_email
or ossn_user_by_guid
but how about custom fields?
Let's say I have a random_field
field in the users table. And do something like below.
$user = input('random_field');
$user = ossn_user_by_random_field($user); // or whatever
$user->data->another_field = true;
if($user->save()){}
Any help would be much appreciated.
Thanks Arsalan!
Here if you wanted to list all users with that field
$users = new OssnUser;
$list = $users->searchUsers(array(
'entities_pairs' => array(
array(
'name' => 'another_field',
'value' => true,
),
)
));
echo ossn_dump($list);
..
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)