public static function getRandomActive($limit = 1, $nonProfit = false, $excluding = array()) { $orgData = new FM_Models_FM_Orgdata(); $orgs = $orgData->getRandomOrg($limit, $nonProfit); foreach ($orgs as $org) { $org = new FM_Components_Organization(array('id' => $org['id'])); foreach ($org->getCats() as $i => $id) { if (!in_array($id, $excluding)) { $returnOrgs[] = $org; } } } return count($returnOrgs) ? $returnOrgs : FM_Components_Organization::getRandom($limit, $nonProfit, $excluding); }