Search::resetSaveSearch PHP Method

resetSaveSearch() static public method

Reset save searches
static public resetSaveSearch ( ) : nothing
return nothing
    static function resetSaveSearch()
    {
        unset($_SESSION['glpisearch']);
        $_SESSION['glpisearch'] = array();
    }

Usage Example

示例#1
0
文件: SearchTest.php 项目: btry/glpi
 private function doSearch($itemtype, $params, array $forcedisplay = array())
 {
     global $DEBUG_SQL;
     // check param itemtype exists (to avoid search errors)
     $this->assertTrue(is_subclass_of($itemtype, "CommonDBTM"));
     // login to glpi if needed
     if (!isset($_SESSION['glpiname'])) {
         $this->Login();
     }
     // force session in debug mode (to store & retrieve sql errors)
     $glpi_use_mode = $_SESSION['glpi_use_mode'];
     $_SESSION['glpi_use_mode'] = Session::DEBUG_MODE;
     // don't compute last request from session
     $params['reset'] = 'reset';
     // do search
     $params = Search::manageParams($itemtype, $params);
     $data = Search::getDatas($itemtype, $params, $forcedisplay);
     // append existing errors to returned data
     $data['last_errors'] = array();
     if (isset($DEBUG_SQL['errors'])) {
         $data['last_errors'] = implode(', ', $DEBUG_SQL['errors']);
         unset($DEBUG_SQL['errors']);
     }
     // restore glpi mode to previous
     $_SESSION['glpi_use_mode'] = $glpi_use_mode;
     // do not store this search from session
     Search::resetSaveSearch();
     return $data;
 }
All Usage Examples Of Search::resetSaveSearch