public function getSurveysByCode($code)
    {
        $cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $code;

        if ($results = $this->cache->load($cacheId)) {
            return $results;
        }

        $select = $this->db->select();
        $select->from('gems__surveys', array('gsu_id_survey', 'gsu_survey_name'))
                ->where("gsu_code = ?", $code)
                ->where("gsu_active = 1")
                ->order('gsu_survey_name');

        $results = $this->db->fetchPairs($select);
        $this->cache->save($results, $cacheId, array('surveys'));
        return $results;
    }
public function getSurveysByCode($code)
    {
        $cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $code;

        if ($results = $this->cache->load($cacheId)) {
            return $results;
        }

        $select = $this->db->select();
        $select->from('gems__surveys', array('gsu_id_survey', 'gsu_survey_name'))
                ->where("gsu_code = ?", $code)
                ->where("gsu_active = 1")
                ->order('gsu_survey_name');

        $results = $this->db->fetchPairs($select);
        $this->cache->save($results, $cacheId, array('surveys'));
        return $results;
    }
public function getSurveysByCode ( $ code ) { $ cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $ code ; if ( $ results = $ this -> cache -> load ( $ cacheId ) ) { return $ results ; } $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__surveys' , array ( 'gsu_id_survey' , 'gsu_survey_name' ) ) -> where ( "gsu_code = ?" , $ code ) -> where ( "gsu_active = 1" ) -> order ( 'gsu_survey_name' ) ; $ results = $ this -> db -> fetchPairs ( $ select ) ; $ this -> cache -> save ( $ results , $ cacheId , array ( 'surveys' ) ) ; return $ results ; }
Get all the surveys for a certain code

@param string $code
@return array survey id => survey name
Get all the surveys for a certain code