public static function hasAgents($zoneId) { //$db = ZitDBAdapter::getDBAdapter(); $db = Zend_Registry::get('my_db'); // $query = "select agent_id as num_rows from agent_zone_context where zone_id = ".$zoneId; // $result = $db->fetchAll($query); $azc = new AgentZoneContext($db); $where = "zone_id = {$zoneId}"; $result = $azc->fetchAll($where); if ($result->count() != 0) { return true; } else { return false; } }
public static function allowedToRegister($agentId) { $db = Zend_Registry::get('my_db'); $agentZC = new AgentZoneContext($db); $result = $agentZC->fetchAll('agent_id = ' . $agentId . ' and context_id = ' . $_SESSION['CONTEXT_ID'] . ' and zone_id = ' . $_SESSION['ZONE_ID']); if ($result->count() != 1) { return false; } else { return true; } }