ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSearchItemFactory Class Reference
+ Collaboration diagram for ilSearchItemFactory:

Public Member Functions

getInstance ($a_obj_id, $a_user_id= '')
 get an instance of an Ilias object by object id

Detailed Description

Definition at line 33 of file class.ilSearchItemFactory.php.

Member Function Documentation

& ilSearchItemFactory::getInstance (   $a_obj_id,
  $a_user_id = '' 
)

get an instance of an Ilias object by object id

Parameters
int$obj_idobject id
Returns
object instance of Ilias object (i.e. derived from ilObject)

Definition at line 42 of file class.ilSearchItemFactory.php.

References $_SESSION, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilSearchresultGUI\moveItem(), ilSearchresultGUI\rename(), and ilSearchresultGUI\update().

{
global $ilias;
define("TABLE_SEARCH_DATA","search_data");
if(!$a_user_id)
{
$user_id = $_SESSION["AccountId"];
}
$query = "SELECT type FROM ".TABLE_SEARCH_DATA." ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$type = $row->type;
}
switch($type)
{
case "seaf":
include_once "Services/Search/classes/class.ilSearchFolder.php";
return new ilSearchFolder($user_id,$a_obj_id);
case "sea":
include_once "Services/Search/classes/class.ilUserResult.php";
return new ilUserResult($user_id,$a_obj_id);
}
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: