protected function removeInactiveRounds(\Gems_Tracker_RespondentTrack $respTrack, $userId)
    {
        $qTrackId     = $this->db->quote($this->_trackId);
        $qRespTrackId = $this->db->quote($respTrack->getRespondentTrackId());
        $orgId        = $this->db->quote($respTrack->getOrganizationId());

        $where = "gto_start_time IS NULL AND
            gto_id_respondent_track = $qRespTrackId AND
            gto_id_round != 0 AND
            gto_id_round IN (SELECT gro_id_round
                    FROM gems__rounds
                    WHERE (gro_active = 0 OR gro_organizations NOT LIKE CONCAT('%|',$orgId,'|%')) AND
                        gro_id_track = $qTrackId)";

        return $this->db->delete('gems__tokens', $where);
    }
protected function removeInactiveRounds(\Gems_Tracker_RespondentTrack $respTrack, $userId)
    {
        $qTrackId     = $this->db->quote($this->_trackId);
        $qRespTrackId = $this->db->quote($respTrack->getRespondentTrackId());
        $orgId        = $this->db->quote($respTrack->getOrganizationId());

        $where = "gto_start_time IS NULL AND
            gto_id_respondent_track = $qRespTrackId AND
            gto_id_round != 0 AND
            gto_id_round IN (SELECT gro_id_round
                    FROM gems__rounds
                    WHERE (gro_active = 0 OR gro_organizations NOT LIKE CONCAT('%|',$orgId,'|%')) AND
                        gro_id_track = $qTrackId)";

        return $this->db->delete('gems__tokens', $where);
    }
protected function removeInactiveRounds ( \ Gems_Tracker_RespondentTrack $ respTrack , $ userId ) { $ qTrackId = $ this -> db -> quote ( $ this -> _trackId ) ; $ qRespTrackId = $ this -> db -> quote ( $ respTrack -> getRespondentTrackId ( ) ) ; $ orgId = $ this -> db -> quote ( $ respTrack -> getOrganizationId ( ) ) ; $ where = "gto_start_time IS NULL AND
            gto_id_respondent_track = $qRespTrackId AND
            gto_id_round != 0 AND
            gto_id_round IN (SELECT gro_id_round
                    FROM gems__rounds
                    WHERE (gro_active = 0 OR gro_organizations NOT LIKE CONCAT('%|',$orgId,'|%')) AND
                        gro_id_track = $qTrackId)" ; return $ this -> db -> delete ( 'gems__tokens' , $ where ) ; }
Remove the unanswered tokens for inactive rounds.

@param \Gems_Tracker_RespondentTrack $respTrack The respondent track to check
@param int $userId Id of the user who takes the action (for logging)
@return int The number of tokens changed by this code
Remove the unanswered tokens for inactive rounds .