Public Member Functions | |
| & | getInstance ($a_obj_id, $a_user_id= '') |
| get an instance of an Ilias object by object id | |
| & | getInstance ($a_obj_id, $a_user_id= '') |
| get an instance of an Ilias object by object id | |
Definition at line 33 of file class.ilSearchItemFactory.php.
| & ilSearchItemFactory::getInstance | ( | $ | a_obj_id, | |
| $ | a_user_id = '' | |||
| ) |
get an instance of an Ilias object by object id
| int | $obj_id object id |
Definition at line 42 of file class.ilSearchItemFactory.php.
References $_SESSION, $ilias, $query, $res, $row, $type, and $user_id.
Referenced by ilSearchAdministrationGUI::__moveItem(), ilSearchAdministrationGUI::__renameItem(), ilSearchAdministrationGUI::__showRename(), 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 "./classes/class.ilSearchFolder.php";
return new ilSearchFolder($user_id,$a_obj_id);
case "sea":
include_once "./classes/class.ilSearchResult.php";
return new ilSearchResult($user_id,$a_obj_id);
}
}
Here is the caller graph for this function:| & ilSearchItemFactory::getInstance | ( | $ | a_obj_id, | |
| $ | a_user_id = '' | |||
| ) |
get an instance of an Ilias object by object id
| int | $obj_id object id |
Definition at line 42 of file class.ilSearchItemFactory.php.
References $_SESSION, $ilias, $query, $res, $row, $type, and $user_id.
{
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);
}
}
1.7.1