32 $query =
"SELECT * FROM object_data ".
33 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
37 return $res->numRows() ? true :
false;
51 $query =
"SELECT * FROM object_data,object_reference ".
52 "WHERE object_reference.obj_id = object_data.obj_id ".
53 " AND object_data.type=".$ilDB->quote($object_type,
'text').
54 " AND object_data.owner = ".$ilDB->quote($owner_id,
'integer');
59 $obj_ids [] = $object_rec[
"obj_id"];
74 global $ilias, $objDefinition,
$ilDB;
77 if (!isset($a_obj_id))
79 $message =
"ilObjectFactory::getInstanceByObjId(): No obj_id given!";
80 if ($stop_on_error ===
true)
82 $ilias->raiseError($message,$ilias->error_obj->WARNING);
85 #var_dump("<pre>",$message,"<pre>"); 91 $q =
"SELECT * FROM object_data ".
92 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
93 $object_set = $ilias->db->query($q);
95 if ($object_set->numRows() == 0)
97 $message =
"ilObjectFactory::getInstanceByObjId(): Object with obj_id: ".$a_obj_id.
" not found!";
98 if ($stop_on_error ===
true)
100 $ilias->raiseError($message,$ilias->error_obj->WARNING);
103 #var_dump("<pre>",$message,"<pre>"); 108 $class_name =
"ilObj".$objDefinition->getClassName($object_rec[
"type"]);
111 if ($class_name ==
"ilObj")
113 $message =
"ilObjectFactory::getInstanceByObjId(): Not able to determine object ".
114 "class for type".$object_rec[
"type"].
".";
115 if ($stop_on_error ===
true)
117 $ilias->raiseError($message,$ilias->error_obj->WARNING);
124 $location = $objDefinition->getLocation($object_rec[
"type"]);
127 include_once(
$location.
"/class.".$class_name.
".php");
128 $obj =
new $class_name(0,
false);
129 $obj->setId($a_obj_id);
144 global $ilias, $objDefinition,
$ilDB;
147 if (!isset($a_ref_id))
149 if ($stop_on_error ===
true)
151 $message =
"ilObjectFactory::getInstanceByRefId(): No ref_id given!";
152 $ilias->raiseError($message,$ilias->error_obj->WARNING);
161 $query =
"SELECT * FROM object_data,object_reference ".
162 "WHERE object_reference.obj_id = object_data.obj_id ".
163 "AND object_reference.ref_id = ".$ilDB->quote($a_ref_id,
'integer');
164 $object_set = $ilDB->query(
$query);
167 if ($object_set->numRows() == 0)
169 if ($stop_on_error ===
true)
171 $message =
"ilObjectFactory::getInstanceByRefId(): Object with ref_id ".$a_ref_id.
" not found!";
172 $ilias->raiseError($message,$ilias->error_obj->WARNING);
180 $class_name =
"ilObj".$objDefinition->getClassName($object_rec[
"type"]);
183 if ($class_name ==
"ilObj")
185 if ($stop_on_error ===
true)
187 $message =
"ilObjectFactory::getInstanceByRefId(): Not able to determine object ".
188 "class for type".$object_rec[
"type"].
".";
189 $ilias->raiseError($message,$ilias->error_obj->WARNING);
197 $location = $objDefinition->getLocation($object_rec[
"type"]);
200 include_once(
$location.
"/class.".$class_name.
".php");
201 $obj =
new $class_name(0,
false);
202 $obj->setId($object_rec[
"obj_id"]);
203 $obj->setRefId($a_ref_id);
218 global $ilias, $objDefinition,
$ilDB;
221 if (!isset($a_ref_id))
223 if ($stop_on_error ===
true)
225 $message =
"ilObjectFactory::getTypeByRefId(): No ref_id given!";
226 $ilias->raiseError($message,$ilias->error_obj->WARNING);
234 $q =
"SELECT * FROM object_data ".
235 "LEFT JOIN object_reference ON object_data.obj_id=object_reference.obj_id ".
236 "WHERE object_reference.ref_id=".$ilDB->quote($a_ref_id,
'integer');
237 $object_set = $ilias->db->query($q);
239 if ($object_set->numRows() == 0)
241 if ($stop_on_error ===
true)
243 $message =
"ilObjectFactory::getTypeByRefId(): Object with ref_id ".$a_ref_id.
" not found!";
244 $ilias->raiseError($message,$ilias->error_obj->WARNING);
252 return $object_rec[
"type"];
262 global $objDefinition;
264 $location = $objDefinition->getLocation($a_obj_type);
265 $class_name =
"ilObj".$objDefinition->getClassName($a_obj_type);
268 include_once(
$location.
"/class.".$class_name.
".php");
static getClassByType($a_obj_type)
Get class by type.
ObjectIdExists($a_obj_id)
check if obj_id exists.
getObjectsForOwner($object_type, $owner_id)
returns all objects of an owner, filtered by type, objects are not deleted!
static getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id