I am evaluating some custom code in a rule. I want to get a list of users, then load all of the associated profiles from the profile2 module. My code below, loads all the users, and I got an array of the UIDs to put into the profile_load_multiple() function but it is just returning one user profile, I want to return all profiles. Eventually I want to compare a term from a field (project resources) in the node 'project' I am creating with a field (resources) that is in each user main profile. My intention is using rules to accomplish this.
$users = entity_load('user');
$arrayuids = array();
foreach ($users as $user)
{
array_push($arrayuids, $user->uid);
}
$profile = profile2_load_multiple($arrayuids, FALSE);
dsm($arrayuids);
dsm($profile);