Form Email Plugin Condition Failing

SoilentRed

Caaan do!
I'm trying to send an email to a "leader of leaders". So I'm building an array of the groups (id) he runs. Then I'm building an array of the submitter's groups and I'm seeing if there are any matches to return the desired true or false value.
Code:
// Get Mark Groups and build array
$dbMarkGroups = JFactory:: getDbo();
$dbMarkGroups->setQuery('SELECT id FROM #__community_groups WHERE ownerid = 4453');
$markGroups = $dbMarkGroups->loadObjectList();
foreach ($markGroups as $markGroup => $mg) {
$mgroups[] = $mg['id'];
}
// Get Agent Groups and build array
$dbAgent = JFactory:: getDbo();
$dbAgent->setQuery('SELECT groupid FROM #__community_groups_members WHERE memberid = {$my->id}');
$agentGroups = $db->loadObjectList();
foreach ($agentGroups as $agentGroup => $ag) {
$agroups[] = $ag['groupid'];
}
//Compare arrays. If there's anything in the array, send the message.
$comparison = array_intersect($mgroups, $agroups);
if (!empty($comparison)) {
return true;
} else {
return false;
}
Everything looks hunky-dory to me, but I'm getting this error:
Code:
0 - Cannot use object of type stdClass as array
Does anyone see where I'm messed up?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top