Can someone explain this method to me?

Permalink
function getResult($pSort)

I'm not sure what it is looking for in the $pSort variable. Based on what is in the method, arg[2] is the SQL order keyword, arg[3] is the chunk size.

I'm not sure what arg[0] or arg[1] would contain.

I'm trying to get the users from UserSearch with a specific attribute value.

$us = new UserSearch(array('usertype' => 'Investor'));
$res = $us->getResult(); // <- error here


Can anyone give me some guidance with this one? Thanks!

Darkwater23
 
Darkwater23 replied on at Permalink Reply
Darkwater23
I'm trying to use the UserSearch class to get users with a specific attribute and value. However, it is returning all users. What's the best way to get a result set of users with a specific attribute and value?

$us = new UserSearch(array('usertype' => 'Investor'));
$res = $us->getResult('uName',0,'asc')


Thanks!
Darkwater23 replied on at Permalink Reply
Darkwater23
Ah, got it!

I thought I needed to prefix the key names with 'uak_' in my search array to filter by user attribute.

Like so:

$us = new UserSearch(array('uak_usertype' => 'Investor'));


And, that is correct, but you have to use the id of the attribute. I manually passed '2' (the id of the attribute and it worked! Now, I'll see if I can find the method for returning the ID of an attribute with a given name.