Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 class ilSearchItemFactory
00034 {
00035
00042 function &getInstance($a_obj_id,$a_user_id = '')
00043 {
00044 global $ilias;
00045
00046 define("TABLE_SEARCH_DATA","search_data");
00047
00048 if(!$a_user_id)
00049 {
00050 $user_id = $_SESSION["AccountId"];
00051 }
00052
00053 $query = "SELECT type FROM ".TABLE_SEARCH_DATA." ".
00054 "WHERE obj_id = '".$a_obj_id."'";
00055
00056 $res = $this->ilias->db->query($query);
00057 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00058 {
00059 $type = $row->type;
00060 }
00061
00062 switch($type)
00063 {
00064 case "seaf":
00065
00066 include_once "./classes/class.ilSearchFolder.php";
00067
00068 return new ilSearchFolder($user_id,$a_obj_id);
00069
00070 case "sea":
00071
00072 include_once "./classes/class.ilSearchResult.php";
00073
00074 return new ilSearchResult($user_id,$a_obj_id);
00075 }
00076 }
00077 }
00078 ?>