Public Member Functions | Static Public Member Functions | Data Fields

ilObject Class Reference

Inheritance diagram for ilObject:

Public Member Functions

 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 read ($a_force_db=false)
 read object data from db into object
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getTitle ()
 get object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 update ()
 update object in db
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _getAllReferences ($a_id)
 get all reference ids of object
 _lookupTitle ($a_id)
 lookup object title
 _lookupDescription ($a_id)
 lookup object description
 _lookupObjId ($a_id)
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _lookupType ($a_id, $a_reference=false)
 lookup object type
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _lookupObjectId ($a_ref_id)
 lookup object id
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 ilClone ($a_parent_ref)
 ilClone object into tree basic clone function.
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!!
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public
 createRoleFolder ()
 creates a local role folder
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts.
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 _checkCondition ($a_obj_id, $a_operator, $a_value)

Static Public Member Functions

 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data

Data Fields

 $ilias
 $lng
 $id
 $ref_id
 $type
 $title
 $desc
 $owner
 $create_date
 $last_update
 $import_id
 $register = false
 $referenced
 $objectList
 $max_title
 $max_desc
 $add_dots
 $obj_data_record
 object_data record

Detailed Description

Definition at line 35 of file class.ilObject.php.


Member Function Documentation

ilObject::_checkCondition ( a_obj_id,
a_operator,
a_value 
)

Reimplemented in ilObjTest, ilObjExercise, and ilObjCourse.

Definition at line 1158 of file class.ilObject.php.

        {
                switch($a_operator)
                {
                        default:
                                return true;
                }
        }

ilObject::_exists ( a_id,
a_reference = false 
) [static]

checks if an object exists in object_data

public

Parameters:
integer object id or reference id
boolean ture if id is a reference, else false (default)
Returns:
boolean true if object exists

Definition at line 1082 of file class.ilObject.php.

References $ilias, and $q.

Referenced by _lookupOwnerName(), ilObjRoleFolderGUI::confirmedDeleteObject(), ilObjRole::delete(), ilForum::fetchPostNodeData(), ilForum::getUserData(), and ilRepositoryGUI::showForums().

        {
                global $ilias;
                
                if ($a_reference)
                {
                        $q = "SELECT * FROM object_data ".
                                 "LEFT JOIN object_reference ON object_reference.obj_id=object_data.obj_id ".
                                 "WHERE object_reference.ref_id='".$a_id."'";
                }
                else
                {
                        $q = "SELECT * FROM object_data WHERE obj_id='".$a_id."'";
                }
                
                $r = $ilias->db->query($q);

                return $r->numRows() ? true : false;
        }

Here is the caller graph for this function:

ilObject::_getAllReferences ( a_id  ) 

get all reference ids of object

Parameters:
int $a_id object id

Definition at line 633 of file class.ilObject.php.

References $q.

Referenced by ilStructureObject::_goto(), ilLMPageObject::_goto(), ilGlossaryTerm::_goto(), and _hasUntrashedReference().

        {
                global $ilDB;

                $q = "SELECT * FROM object_reference WHERE obj_id = '".$a_id."'";
                $obj_set = $ilDB->query($q);
                $ref = array();

                while ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $ref[$obj_rec["ref_id"]] = $obj_rec["ref_id"];
                }

                return $ref;
        }

Here is the caller graph for this function:

ilObject::_getIdForImportId ( a_import_id  ) 

get current object id for import id (static)

Parameters:
int $a_import_id import id
Returns:
int id

Definition at line 610 of file class.ilObject.php.

References $q.

        {
                global $ilDB;
                
                $q = "SELECT * FROM object_data WHERE import_id = '".$a_import_id."'".
                        " ORDER BY create_date DESC LIMIT 1";
                $obj_set = $ilDB->query($q);

                if ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        return $obj_rec["obj_id"];
                }
                else
                {
                        return 0;
                }
        }

ilObject::_getObjectsDataForType ( a_type,
a_omit_trash = false 
)

get all objects of a certain type

Parameters:
string $a_type desired object type
boolean $a_omit_trash omit objects, that are in trash only (default: false)
Returns:
array array of object data arrays ("id", "title", "type", "description")

Definition at line 818 of file class.ilObject.php.

References $q, and _hasUntrashedReference().

Referenced by ilObjSysUserTrackingGUI::trackingDataQueryFormObject().

        {
                global $ilDB;

                $q = "SELECT * FROM object_data WHERE type = ".$ilDB->quote($a_type);
                $obj_set = $ilDB->query($q);

                $objects = array();
                while ($obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        if ((!$a_omit_trash) || ilObject::_hasUntrashedReference($obj_rec["obj_id"]))
                        {
                                $objects[$obj_rec["title"].".".$obj_rec["obj_id"]] = array("id" => $obj_rec["obj_id"],
                                        "type" => $obj_rec["type"], "title" => $obj_rec["title"],
                                        "description" => $obj_rec["description"]);
                        }
                }
                ksort($objects);
                return $objects;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::_hasUntrashedReference ( a_obj_id  ) 

checks wether an object has at least one reference that is not in trash

Definition at line 778 of file class.ilObject.php.

References $ref_id, _getAllReferences(), and _isInTrash().

Referenced by ilObjSurvey::_getAvailableSurveys(), ilObjTest::_getAvailableTests(), ilLMObject::_getIdForImportId(), ilGlossaryTerm::_getIdForImportId(), _getObjectsDataForType(), ilObjTest::get_qpl_titles(), ilObjTest::getAvailableQuestionpoolIDs(), ilObjSurvey::getAvailableQuestionpools(), ilObjTest::getAvailableQuestionpools(), ilObjSurvey::getForbiddenQuestionpools(), ilObjTest::getForbiddenQuestionpools(), and ilObjSurvey::getQuestionpoolTitles().

        {
                $ref_ids  = ilObject::_getAllReferences($a_obj_id);
                foreach($ref_ids as $ref_id)
                {
                        if(!ilObject::_isInTrash($ref_id))
                        {
                                return true;
                        }
                }

                return false;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::_isInTrash ( a_ref_id  ) 

checks wether object is in trash

Definition at line 768 of file class.ilObject.php.

References $tree.

Referenced by _hasUntrashedReference().

        {
                global $tree;

                return $tree->isSaved($a_ref_id);
        }

Here is the caller graph for this function:

ilObject::_lookupDescription ( a_id  ) 

lookup object description

Parameters:
int $a_id object id

Definition at line 670 of file class.ilObject.php.

References $q.

Referenced by ilObjStyleSheetFolderGUI::viewObject(), and ilObjStyleSettingsGUI::viewObject().

        {
                global $ilDB;

                $q = "SELECT description FROM object_data WHERE obj_id = '".$a_id."'";
                $obj_set = $ilDB->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);

                return $obj_rec["description"];
        }

Here is the caller graph for this function:

ilObject::_lookupObjectId ( a_ref_id  ) 

lookup object id

Parameters:
int $a_id object id

Definition at line 797 of file class.ilObject.php.

References $q.

Referenced by ilObjContentObjectGUI::addMenuEntry(), and ilRepositoryExplorer::isClickable().

        {
                global $ilDB;

                $q = "SELECT obj_id FROM object_reference WHERE ref_id = '".$a_ref_id."'";
                $obj_set = $ilDB->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);

                return $obj_rec["obj_id"];
        }

Here is the caller graph for this function:

ilObject::_lookupObjId ( a_id  ) 

Definition at line 681 of file class.ilObject.php.

References $query, $res, and $row.

Referenced by ilObjCategoryGUI::__buildFilterSelect(), ilSearch::__checkAccess(), ilTableOfContentsExplorer::buildTitle(), ilLMPresentationGUI::getLinkXML(), ilLMPageObjectGUI::getLinkXML(), ilPersonalDesktopGUI::getSelectedItemBlockHTML(), and ilObjCategoryGUI::listUsersObject().

        {
                global $ilDB;

                $query = "SELECT obj_id FROM object_reference ".
                        "WHERE ref_id = '".$a_id."'";
                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        return $row->obj_id;
                }
                return 0;
        }

Here is the caller graph for this function:

ilObject::_lookupOwnerName ( a_owner_id  ) 

lookup owner name for owner id

Definition at line 426 of file class.ilObject.php.

References $lng, $owner, and _exists().

Referenced by getOwnerName(), ilRepositoryGUI::showChats(), ilRepositoryGUI::showCourses(), ilRepositoryGUI::showFolders(), ilRepositoryGUI::showGroups(), ilRepositoryGUI::showiLincClassrooms(), ilRepositoryGUI::showiLincCourses(), and ilRepositoryGUI::showLinkResources().

        {
                global $lng;
                
                if ($a_owner_id != -1)
                {
                        if (ilObject::_exists($a_owner_id))
                        {
                                $owner = new ilObjUser($a_owner_id);
                        }
                }

                if (is_object($owner))
                {
                        $own_name = $owner->getFullname();
                }
                else
                {
                        $own_name = $lng->txt("unknown");
                }

                return $own_name;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::_lookupTitle ( a_id  ) 
ilObject::_lookupType ( a_id,
a_reference = false 
)

lookup object type

Parameters:
int $a_id object id

Definition at line 740 of file class.ilObject.php.

References $q.

Referenced by ilSoapUserAdministration::__validateUserData(), ilHistory::_createEntry(), ilConditionHandler::_getConditionsOfTarget(), ilHistory::_getEntriesForObject(), ilLMPageObject::_splitPage(), ilLMPageObject::_splitPageNext(), ilObjContentObjectGUI::addMenuEntry(), ilObjRoleGUI::assignDesktopItemObject(), ilObjMediaPoolGUI::confirmRemove(), ilObjMediaPoolGUI::copyToClipboard(), ilObjMediaPool::deleteChild(), ilRepositoryGUI::executeCommand(), ilLMPresentationGUI::getLinkXML(), ilLMPageObjectGUI::getLinkXML(), ilHistoryGUI::ilHistoryGUI(), ilInternalLinkGUI::ilInternalLinkGUI(), and ilPCParagraph::xml2output().

        {
                global $ilDB;

                if ($a_reference === true)
                {
                        $q = "SELECT type FROM object_reference as obr, object_data as obd ".
                                "WHERE obr.ref_id = '".$a_id."' ".
                                "AND obr.obj_id = obd.obj_id ";
                        
                        #$q = "SELECT type FROM object_data as obj ".
                        #        "LEFT JOIN object_reference as ref ON ref.obj_id=obj.obj_id ".
                        #        "WHERE ref.ref_id = '".$a_id."'";
                }
                else
                {
                        $q = "SELECT type FROM object_data WHERE obj_id = '".$a_id."'";
                }

                $obj_set = $ilDB->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);

                return $obj_rec["type"];
        }

Here is the caller graph for this function:

ilObject::_writeDescription ( a_obj_id,
a_desc 
)

write description to db (static)

Parameters:
int $a_obj_id object id
string $a_desc description public

Definition at line 722 of file class.ilObject.php.

References $q.

Referenced by ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjSurveyGUI::uploadObject(), ilObjTestGUI::uploadObject(), ilObjQuestionPoolGUI::uploadQplObject(), and ilObjSurveyQuestionPoolGUI::uploadSplObject().

        {
                global $ilDB;

                $q = "UPDATE object_data ".
                        "SET ".
                        "description = ".$ilDB->quote($a_desc).",".
                        "last_update = now() ".
                        "WHERE obj_id = ".$ilDB->quote($a_obj_id);

                $ilDB->query($q);
        }

Here is the caller graph for this function:

ilObject::_writeTitle ( a_obj_id,
a_title 
)

write title to db (static)

Parameters:
int $a_obj_id object id
string $a_title title public

Definition at line 702 of file class.ilObject.php.

References $q.

Referenced by ilObjGlossaryGUI::importFileObject(), ilObjContentObjectGUI::importFileObject(), ilObjSurveyGUI::uploadObject(), ilObjTestGUI::uploadObject(), ilObjQuestionPoolGUI::uploadQplObject(), and ilObjSurveyQuestionPoolGUI::uploadSplObject().

        {
                global $ilDB;

                $q = "UPDATE object_data ".
                        "SET ".
                        "title = ".$ilDB->quote($a_title).",".
                        "last_update = now() ".
                        "WHERE obj_id = ".$ilDB->quote($a_obj_id);

                $ilDB->query($q);
        }

Here is the caller graph for this function:

ilObject::countReferences (  ) 

count references of object

public

Returns:
integer number of references for this object

Definition at line 908 of file class.ilObject.php.

References $q, and $row.

Referenced by delete().

        {
                if (!isset($this->id))
                {
                        $message = "ilObject::countReferences(): No obj_id given!";
                        $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                }

                $q = "SELECT COUNT(ref_id) AS num FROM object_reference ".
                        "WHERE obj_id = '".$this->id."'";
                $row = $this->ilias->db->getRow($q);

                return $row->num;
        }

Here is the caller graph for this function:

ilObject::create (  ) 

create

note: title, description and type should be set when this function is called

public

Returns:
integer object id

Reimplemented in ilObjFile, ilObjMediaObject, ilObjNoteFolder, ilObjRole, ilObjStyleSheet, ilObjFileBasedLM, ilObjMediaPool, ilObjSAHSLearningModule, and ilObjMediaObject.

Definition at line 502 of file class.ilObject.php.

References $ilUser, $log, $q, getDescription(), getImportId(), getTitle(), ilUtil::prepareDBString(), setOwner(), and ilUtil::shortenText().

Referenced by ilObjSurveyQuestionPool::create(), ilObjSurvey::create(), ilObjGlossary::create(), ilObjContentObject::create(), ilObjCourse::create(), ilObjTest::create(), ilObjQuestionPool::create(), and ilObjNote::createObject().

        {
                global $ilDB, $log,$ilUser;

                if (!isset($this->type))
                {
                        $message = get_class($this)."::create(): No object type given!";
                        $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                }
                
                // write log entry
                $log->write("ilObject::create(), start");

                $this->title = ilUtil::shortenText($this->getTitle(), $this->max_title, $this->add_dots);
                $this->desc = ilUtil::shortenText($this->getDescription(), $this->max_desc, $this->add_dots);

                $q = "INSERT INTO object_data ".
                         "(type,title,description,owner,create_date,last_update,import_id) ".
                         "VALUES ".
                         "('".$this->type."',".$ilDB->quote($this->getTitle()).",'".ilUtil::prepareDBString($this->getDescription())."',".
                         "'".$ilUser->getId()."',now(),now(),'".
                        $this->getImportId()."')";

                $ilDB->query($q);

                $this->id = $ilDB->getLastInsertId();

                // the line ($this->read();) messes up meta data handling: meta data,
                // that is not saved at this time, gets lost, so we query for the dates alone
                //$this->read();
                $q = "SELECT last_update, create_date FROM object_data".
                         " WHERE obj_id = '".$this->id."'";
                $obj_set = $this->ilias->db->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
                $this->last_update = $obj_rec["last_update"];
                $this->create_date = $obj_rec["create_date"];

                // set owner for new objects
                $this->setOwner($ilUser->getId());

                // write log entry
                $log->write("ilObject::create(), finished, obj_id: ".$this->id.", type: ".
                        $this->type.", title: ".$this->getTitle());

                return $this->id;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::createReference (  ) 

creates reference for object

public

Returns:
integer reference_id of object

Reimplemented in ilObjTest, ilObjMediaObject, ilObjStyleSheet, ilObjMediaObject, and ilObjSurvey.

Definition at line 882 of file class.ilObject.php.

References $q.

        {
                global $ilDB;

                if (!isset($this->id))
                {
                        $message = "ilObject::createNewReference(): No obj_id given!";
                        $this->raiseError($message,$this->ilias->error_obj->WARNING);
                }

                $q = "INSERT INTO object_reference ".
                         "(obj_id) VALUES ('".$this->id."')";
                $this->ilias->db->query($q);

                $this->ref_id = $ilDB->getLastInsertId();

                return $this->ref_id;
        }

ilObject::createRoleFolder (  ) 

creates a local role folder

public

Parameters:
string rolefolder title
string rolefolder description
object parent object where the rolefolder is attached to
Returns:
object rolefolder object

Definition at line 1048 of file class.ilObject.php.

References $rbacreview, getId(), and getRefId().

Referenced by ilObjCourse::__initDefaultRoles(), ilObjContentObject::initDefaultRoles(), ilObjGroup::initDefaultRoles(), and ilObjForum::initDefaultRoles().

        {
                global $rbacreview;
                
                // does a role folder already exists?
                // (this check is only 'to be sure' that no second role folder is created under one object.
                // the if-construct should never return true)
                if ($rolf_data = $rbacreview->getRoleFolderofObject($this->getRefId()))
                {
                        $rfoldObj = $this->ilias->obj_factory->getInstanceByRefId($rolf_data["ref_id"]);
                }
                else
                {
                        include_once ("classes/class.ilObjRoleFolder.php");
                        $rfoldObj = new ilObjRoleFolder();
                        $rfoldObj->setTitle($this->getId());
                        $rfoldObj->setDescription(" (ref_id ".$this->getRefId().")");
                        $rfoldObj->create();
                        $rfoldObj->createReference();
                        $rfoldObj->putInTree($this->getRefId());
                        $rfoldObj->setPermissions($this->getRefId());
                }
                
                return $rfoldObj;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::delete (  ) 

delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!!

public

Returns:
boolean true if object was removed completely; false if only a references was removed

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjChat, ilObjAssessmentFolder, ilObjAuthSettings, ilObjCategory, ilObjCourse, ilObjExercise, ilObjFile, ilObjForum, ilObjGroup, ilObjLibFolder, ilObjObjectFolder, ilObjRecoveryFolder, ilObjRole, ilObjRoleFolder, ilObjRoleTemplate, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheet, ilObjStyleSheetFolder, ilObjSystemFolder, ilObjSysUserTracking, ilObjUser, ilObjUserFolder, ilObj< module_name >, ilObjAICCLearningModule, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjMediaObject, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjLinkResource, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 968 of file class.ilObject.php.

References $log, $q, $rbacadmin, countReferences(), getId(), getRefId(), getTitle(), and getType().

        {
                global $rbacadmin, $log;

                $remove = false;

                // delete object_data entry
                if ((!$this->referenced) || ($this->countReferences() == 1))
                {
                        // delete entry in object_data
                        $q = "DELETE FROM object_data ".
                                "WHERE obj_id = '".$this->getId()."'";
                        $this->ilias->db->query($q);

                        // write log entry
                        $log->write("ilObject::delete(), deleted object, obj_id: ".$this->getId().", type: ".
                                $this->getType().", title: ".$this->getTitle());
                        
                        $remove = true;
                }
                else
                {
                        // write log entry
                        $log->write("ilObject::delete(), object not deleted, number of references: ".
                                $this->countReferences().", obj_id: ".$this->getId().", type: ".
                                $this->getType().", title: ".$this->getTitle());
                }

                // delete object_reference entry
                if ($this->referenced)
                {
                        // delete entry in object_reference
                        $q = "DELETE FROM object_reference ".
                                "WHERE ref_id = '".$this->getRefId()."'";
                        $this->ilias->db->query($q);

                        // write log entry
                        $log->write("ilObject::delete(), reference deleted, ref_id: ".$this->getRefId().
                                ", obj_id: ".$this->getId().", type: ".
                                $this->getType().", title: ".$this->getTitle());

                        // DELETE PERMISSION ENTRIES IN RBAC_PA
                        // DONE: method overwritten in ilObjRole & ilObjUser.
                        // this call only applies for objects in rbac (not usr,role,rolt)
                        // TODO: Do this for role templates too
                        $rbacadmin->revokePermission($this->getRefId());
                }

                // remove conditions
                if ($this->referenced)
                {
                        $ch =& new ilConditionHandler();
                        $ch->delete($this->getRefId());
                        unset($ch);
                }

                return $remove;
        }

Here is the call graph for this function:

ilObject::getCreateDate (  ) 

get create date public

Returns:
string creation date

Definition at line 466 of file class.ilObject.php.

        {
                return $this->create_date;
        }

ilObject::getDescription (  ) 
ilObject::getHTMLDirectory (  ) 

Reimplemented in ilObjChat.

Definition at line 1152 of file class.ilObject.php.

        {
                return false;
        }

ilObject::getId (  ) 

get object id public

Returns:
integer object id

Reimplemented in ilObjMediaObject.

Definition at line 275 of file class.ilObject.php.

Referenced by ilObjCourse::__initDefaultRoles(), ilObjCourse::__initMetaObject(), ilObjUser::addDesktopItem(), ilObjUser::addObjectToClipboard(), ilObjContentObject::checkTree(), ilObjSurveyQuestionPool::create(), ilObjSurvey::create(), ilObjSAHSLearningModule::create(), ilObjMediaPool::create(), ilObjGlossary::create(), ilObjFileBasedLM::create(), ilObjContentObject::create(), ilObjFile::create(), ilObjCourse::create(), ilObjTest::create(), ilObjQuestionPool::create(), ilObjSurveyQuestionPool::createExportDirectory(), ilObjSurvey::createExportDirectory(), ilObjGlossary::createExportDirectory(), ilObjContentObject::createExportDirectory(), ilObjTest::createExportDirectory(), ilObjQuestionPool::createExportDirectory(), ilObjSurveyQuestionPool::createImportDirectory(), ilObjSurvey::createImportDirectory(), ilObjGlossary::createImportDirectory(), ilObjContentObject::createImportDirectory(), ilObjTest::createImportDirectory(), ilObjQuestionPool::createImportDirectory(), ilObjContentObject::createLMTree(), ilObjNote::createObject(), createRoleFolder(), ilObjLinkResource::delete(), ilObjSAHSLearningModule::delete(), ilObjGlossary::delete(), ilObjFileBasedLM::delete(), ilObjContentObject::delete(), ilObjAICCLearningModule::delete(), ilObjUser::delete(), ilObjStyleSheet::delete(), ilObjRoleTemplate::delete(), ilObjRole::delete(), ilObjForum::delete(), ilObjFile::delete(), delete(), ilObjCourse::delete(), ilObjSurveyQuestionPool::deleteAllData(), ilObjGroup::deleteApplicationListEntry(), ilObjQuestionPool::deleteQuestionpool(), ilObjSurvey::deleteSurveyRecord(), ilObjTest::deleteTest(), ilObjFile::export(), ilObjContentObject::exportHTML(), ilObjContentObject::exportHTMLPages(), ilObjContentObject::exportSCORM(), ilObjContentObject::exportXMLPageObjects(), ilObjUser::getAppliedUsers(), ilObjSAHSLearningModule::getDataDirectory(), ilObjFileBasedLM::getDataDirectory(), ilObjFile::getDirectory(), ilObjUser::getGroupMemberships(), ilObjTest::getImagePath(), ilObjTest::getImagePathWeb(), ilObjSurveyQuestionPool::getQuestionsTable(), ilObjQuestionPool::getQuestionsTable(), ilObjGlossary::getTermList(), ilObjSCORMLearningModule::getTrackingItems(), ilObjAICCLearningModule::getTrackingItems(), ilObjForum::ilClone(), ilObjFile::ilClone(), ilObjExercise::ilClone(), ilClone(), ilObjSurveyQuestionPool::importObject(), ilObjQuestionPool::importObject(), ilObjContentObject::initDefaultRoles(), ilObjGroup::initDefaultRoles(), ilObjForum::initDefaultRoles(), ilObjLinkResource::initLinkResourceItemsObject(), ilObjSurveyQuestionPool::initMeta(), ilObjSurvey::initMeta(), ilObjGlossary::initMeta(), ilObjContentObject::initMeta(), ilObjTest::initMeta(), ilObjQuestionPool::initMeta(), ilObjUser::isChild(), ilObjUser::isDesktopItem(), ilObjTest::logAction(), ilObjGlossary::modifyExportIdentifier(), ilObjSurveyQuestionPool::paste(), ilObjFolder::putInTree(), putInTree(), ilObjSurveyQuestionPool::read(), ilObjSurvey::read(), ilObjSAHSLearningModule::read(), ilObjMediaPool::read(), ilObjFileBasedLM::read(), ilObjContentObject::read(), ilObjStyleSheetFolder::read(), ilObjStyleSettings::read(), ilObjRoleFolder::read(), ilObjExercise::read(), ilObjTest::read(), ilObjQuestionPool::read(), ilObjAICCLearningModule::readObject(), ilObjFile::replaceFile(), ilObjGroup::setExpirationDateTime(), ilObjGroup::setPassword(), ilObjGroup::setRegistrationFlag(), ilObjSurveyQuestionPool::to_xml(), ilObjSAHSLearningModule::update(), ilObjStyleSheetFolder::update(), ilObjStyleSettings::update(), ilObjForum::update(), ilObjUser::writeAccepted(), and ilObjStyleSheet::writeCSSFile().

        {
                return $this->id;
        }

Here is the caller graph for this function:

ilObject::getImportId (  ) 

get import id

public

Returns:
string import id

Reimplemented in ilObjContentObject, ilObjGlossary, and ilObjMediaObject.

Definition at line 385 of file class.ilObject.php.

Referenced by create().

        {
                return $this->import_id;
        }

Here is the caller graph for this function:

ilObject::getLastUpdateDate (  ) 

get last update date public

Returns:
string date of last update

Definition at line 476 of file class.ilObject.php.

        {
                return $this->last_update;
        }

ilObject::getOwner (  ) 

get object owner

public

Returns:
integer owner id

Definition at line 407 of file class.ilObject.php.

Referenced by getOwnerName().

        {
                return $this->owner;
        }

Here is the caller graph for this function:

ilObject::getOwnerName (  ) 

Definition at line 418 of file class.ilObject.php.

References _lookupOwnerName(), and getOwner().

Referenced by ilObjSysUserTracking::getAccessTotalPerObj().

        {
                return ilObject::_lookupOwnerName($this->getOwner());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::getRefId (  ) 
ilObject::getTitle (  ) 
ilObject::getType (  ) 

get object type public

Returns:
string object type

Definition at line 316 of file class.ilObject.php.

Referenced by ilObjCourse::__initMetaObject(), ilObjSurveyQuestionPool::create(), ilObjSurvey::create(), ilObjSAHSLearningModule::create(), ilObjGlossary::create(), ilObjFileBasedLM::create(), ilObjContentObject::create(), ilObjMediaObject::create(), ilObjCourse::create(), ilObjTest::create(), ilObjQuestionPool::create(), ilObjSAHSLearningModule::delete(), ilObjGlossary::delete(), ilObjFileBasedLM::delete(), ilObjContentObject::delete(), ilObjAICCLearningModule::delete(), ilObjMediaObject::delete(), delete(), ilObjContentObject::exportHTML(), ilObjContentObject::exportHTMLPages(), ilObjContentObject::exportSCORM(), ilObjContentObject::exportXML(), ilObjGlossary::exportXMLMetaData(), ilObjContentObject::exportXMLMetaData(), ilObjTest::exportXMLMetaData(), ilObjQuestionPool::exportXMLMetaData(), ilObjMediaObject::getXML(), ilClone(), ilObjSurveyQuestionPool::importObject(), ilObjSurveyQuestionPool::initMeta(), ilObjSurvey::initMeta(), ilObjGlossary::initMeta(), ilObjContentObject::initMeta(), ilObjMediaObject::initMeta(), ilObjTest::initMeta(), ilObjQuestionPool::initMeta(), ilObjGroup::isMember(), ilObjSurveyQuestionPool::notify(), ilObjSurvey::notify(), ilObjSAHSLearningModule::notify(), ilObjMediaPool::notify(), ilObjGlossary::notify(), ilObjFileBasedLM::notify(), ilObjContentObject::notify(), ilObj< module_name >::notify(), ilObjSysUserTracking::notify(), ilObjStyleSheetFolder::notify(), ilObjStyleSettings::notify(), ilObjRecoveryFolder::notify(), ilObjForum::notify(), ilObjCourse::notify(), ilObjAuthSettings::notify(), ilObjAssessmentFolder::notify(), ilObjTest::notify(), ilObjQuestionPool::notify(), putInTree(), ilObjSurveyQuestionPool::read(), ilObjSurvey::read(), ilObjSAHSLearningModule::read(), ilObjFileBasedLM::read(), ilObjMediaObject::read(), ilObjTest::read(), ilObjQuestionPool::read(), setPermissions(), and ilObjMediaObject::update().

        {
                return $this->type;
        }

Here is the caller graph for this function:

ilObject::getXMLZip (  ) 

Reimplemented in ilObjFile, ilObjContentObject, ilObjDlBook, and ilObjGlossary.

Definition at line 1148 of file class.ilObject.php.

        {
                return false;
        }

ilObject::ilClone ( a_parent_ref  ) 

ilClone object into tree basic clone function.

Register new object in object_data, creates reference and insert reference ID in tree. All object specific data must be copied in the ilClone function of the appropriate object class. Look in ilObjForum::ilClone() for example code

public

Parameters:
integer $a_parent_ref ref id of parent object
Returns:
integer new ref id

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjChat, ilObjAssessmentFolder, ilObjAuthSettings, ilObjCategory, ilObjCourse, ilObjExercise, ilObjFile, ilObjGroup, ilObjObjectFolder, ilObjRecoveryFolder, ilObjRole, ilObjRoleFolder, ilObjRoleTemplate, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSystemFolder, ilObjSysUserTracking, ilObjUserFolder, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjLinkResource, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 934 of file class.ilObject.php.

References $log, getDescription(), getId(), getRefId(), getTitle(), getType(), and ilObject().

        {
                global $log;
                
                $new_obj = new ilObject();
                $new_obj->setTitle($this->getTitle());
                $new_obj->setType($this->getType());
                $new_obj->setDescription($this->getDescription());
                $new_obj->create();
                $new_ref_id = $new_obj->createReference();
                $new_obj->putInTree($a_parent_ref);
                $new_obj->setPermissions($a_parent_ref);

                unset($new_obj);
                
                // write log entry
                $log->write("ilObject::ilClone(), ref_id: ".$this->getRefId().",obj_id: ".$this->getId().", type: ".
                        $this->getType().", title: ".$this->getTitle().
                        ", new ref_id: ".$new_obj->getRefId().", new obj_id:".$new_obj->getId());
        
                // ... and finally always return new reference ID!!
                return $new_ref_id;
        }

Here is the call graph for this function:

ilObject::ilObject ( a_id = 0,
a_reference = true 
)

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 110 of file class.ilObject.php.

References $ilBench, $ilias, $lng, and read().

Referenced by ilClone(), ilObjAICCLearningModule::ilObjAICCLearningModule(), ilObjAssessmentFolder::ilObjAssessmentFolder(), ilObjAuthSettings::ilObjAuthSettings(), ilObjCategory::ilObjCategory(), ilObjChat::ilObjChat(), ilObjChatServer::ilObjChatServer(), ilObjContentObject::ilObjContentObject(), ilObjCourse::ilObjCourse(), ilObjExercise::ilObjExercise(), ilObjFile::ilObjFile(), ilObjFileBasedLM::ilObjFileBasedLM(), ilObjFolder::ilObjFolder(), ilObjForum::ilObjForum(), ilObjGlossary::ilObjGlossary(), ilObjGroup::ilObjGroup(), ilObjHACPLearningModule::ilObjHACPLearningModule(), ilObjiLincClassroom::ilObjiLincClassroom(), ilObjiLincCourse::ilObjiLincCourse(), ilObjLanguage::ilObjLanguage(), ilObjLanguageFolder::ilObjLanguageFolder(), ilObjLdap::ilObjLdap(), ilObjLibFolder::ilObjLibFolder(), ilObjLinkResource::ilObjLinkResource(), ilObjMail::ilObjMail(), ilObjMediaObject::ilObjMediaObject(), ilObjMediaPool::ilObjMediaPool(), ilObjNote::ilObjNote(), ilObjNoteFolder::ilObjNoteFolder(), ilObjObjectFolder::ilObjObjectFolder(), ilObjPaymentSettings::ilObjPaymentSettings(), ilObjQuestionPool::ilObjQuestionPool(), ilObjRecoveryFolder::ilObjRecoveryFolder(), ilObjRole::ilObjRole(), ilObjRoleFolder::ilObjRoleFolder(), ilObjRoleTemplate::ilObjRoleTemplate(), ilObjRootFolder::ilObjRootFolder(), ilObjSAHSLearningModule::ilObjSAHSLearningModule(), ilObjSCORMLearningModule::ilObjSCORMLearningModule(), ilObjStyleSettings::ilObjStyleSettings(), ilObjStyleSheet::ilObjStyleSheet(), ilObjStyleSheetFolder::ilObjStyleSheetFolder(), ilObjSurvey::ilObjSurvey(), ilObjSurveyQuestionPool::ilObjSurveyQuestionPool(), ilObjSystemFolder::ilObjSystemFolder(), ilObjSysUserTracking::ilObjSysUserTracking(), ilObjTest::ilObjTest(), ilObjTypeDefinition::ilObjTypeDefinition(), ilObjUser::ilObjUser(), and ilObjUserFolder::ilObjUserFolder().

        {
                global $ilias, $lng, $ilBench;

                $ilBench->start("Core", "ilObject_Constructor");

                if (DEBUG)
                {
                        echo "<br/><font color=\"red\">type(".$this->type.") id(".$a_id.") referenced(".$a_reference.")</font>";
                }

                $this->ilias =& $ilias;
                $this->lng =& $lng;

                $this->max_title = MAXLENGTH_OBJ_TITLE;
                $this->max_desc = MAXLENGTH_OBJ_DESC;
                $this->add_dots = true;

                $this->referenced = $a_reference;
                $this->call_by_reference = $a_reference;

                if ($a_id == 0)
                {
                        $this->referenced = false;              // newly created objects are never referenced
                }                                                                       // they will get referenced if createReference() is called

                if ($this->referenced)
                {
                        $this->ref_id = $a_id;
                }
                else
                {
                        $this->id = $a_id;
                }
                // read object data
                if ($a_id != 0)
                {
                        $this->read();
                }

                $ilBench->stop("Core", "ilObject_Constructor");
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::initDefaultRoles (  ) 

init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public

Returns:
array empty array

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjAssessmentFolder, ilObjAuthSettings, ilObjForum, ilObjGroup, ilObjRecoveryFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjMediaPool, ilObjiLincClassroom, ilObjiLincCourse, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 1034 of file class.ilObject.php.

        {
                return array();
        }

ilObject::isUserRegistered ( a_user_id = 0  ) 

Reimplemented in ilObjGroup.

Definition at line 1137 of file class.ilObject.php.

        {
                return false;
        }

ilObject::notify ( a_event,
a_ref_id,
a_parent_non_rbac_id,
a_node_id,
a_params = 0 
)

notifys an object about an event occured Based on the event passed, each object may decide how it reacts.

TODO: add optional array to pass parameters

public

Parameters:
string event
integer reference id of object where the event occured
integer reference id of node in the tree which is actually notified
array passes optional parameters if required
Returns:
boolean

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjAssessmentFolder, ilObjAuthSettings, ilObjCourse, ilObjForum, ilObjGroup, ilObjRecoveryFolder, ilObjRootFolder, ilObjStyleSettings, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 1114 of file class.ilObject.php.

References $tree.

        { 
                global $tree;
                
                $parent_id = (int) $tree->getParentId($a_node_id);
                
                if ($parent_id != 0)
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
                        $obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
                }
                                
                return true;
        }

ilObject::putInTree ( a_parent_ref  ) 

maybe this method should be in tree object!?

Todo:
role/rbac stuff

Reimplemented in ilObjFolder, and ilObjContentObject.

Definition at line 844 of file class.ilObject.php.

References $log, $tree, getId(), getRefId(), getTitle(), and getType().

        {
                global $tree, $log;

                $tree->insertNode($this->getRefId(), $a_parent_ref);
                
                // write log entry
                $log->write("ilObject::putInTree(), parent_ref: $a_parent_ref, ref_id: ".
                        $this->getRefId().", obj_id: ".$this->getId().", type: ".
                        $this->getType().", title: ".$this->getTitle());

        }

Here is the call graph for this function:

ilObject::read ( a_force_db = false  ) 

read object data from db into object

Parameters:
boolean public

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjForum, ilObjRoleFolder, ilObjCourse, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 168 of file class.ilObject.php.

References $ilBench, $obj, $objDefinition, $q, and $row.

Referenced by ilObject().

        {
                global $objDefinition, $ilBench;

                $ilBench->start("Core", "ilObject_read");

                if (isset($this->obj_data_record) && !$a_force_db)
                {
                        $obj = $this->obj_data_record;
                }
                else if ($this->referenced)
                {
                        // check reference id
                        if (!isset($this->ref_id))
                        {
                                $message = "ilObject::read(): No ref_id given!";
                                $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                        }

                        // read object data
                        $ilBench->start("Core", "ilObject_read_readData");
                        /* old query (very slow)
                        $q = "SELECT * FROM object_data ".
                                 "LEFT JOIN object_reference ON object_data.obj_id=object_reference.obj_id ".
                                 "WHERE object_reference.ref_id='".$this->ref_id."'"; */
                        $q = "SELECT * FROM object_data, object_reference WHERE object_data.obj_id=object_reference.obj_id ".
                                 "AND object_reference.ref_id='".$this->ref_id."'";
                        $object_set = $this->ilias->db->query($q);
                        $ilBench->stop("Core", "ilObject_read_readData");

                        // check number of records
                        if ($object_set->numRows() == 0)
                        {
                                $message = "ilObject::read(): Object with ref_id ".$this->ref_id." not found!";
                                $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                        }

                        $obj = $object_set->fetchRow(DB_FETCHMODE_ASSOC);
                }
                else
                {
                        // check object id
                        if (!isset($this->id))
                        {
                                $message = "ilObject::read(): No obj_id given!";
                                $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                        }

                        // read object data
                        $q = "SELECT * FROM object_data ".
                                 "WHERE obj_id = '".$this->id."'";
                        $object_set = $this->ilias->db->query($q);

                        // check number of records
                        if ($object_set->numRows() == 0)
                        {
                                $message = "ilObject::read(): Object with obj_id: ".$this->id." not found!";
                                $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                        }

                        $obj = $object_set->fetchRow(DB_FETCHMODE_ASSOC);
                }

                $this->id = $obj["obj_id"];
                $this->type = $obj["type"];
                $this->title = $obj["title"];
                $this->desc = $obj["description"];
                $this->owner = $obj["owner"];
                $this->create_date = $obj["create_date"];
                $this->last_update = $obj["last_update"];
                $this->import_id = $obj["import_id"];

                // multilingual support systemobjects (sys) & categories (db)
                $ilBench->start("Core", "ilObject_Constructor_getTranslation");
                $translation_type = $objDefinition->getTranslationType($this->type);

                if ($translation_type == "sys")
                {
                        $this->title = $this->lng->txt("obj_".$this->type);
                        $this->desc = $this->lng->txt("obj_".$this->type."_desc");
                }
                elseif ($translation_type == "db")
                {
                        $q = "SELECT title,description FROM object_translation ".
                                 "WHERE obj_id = ".$this->id." ".
                                 "AND lang_code = '".$this->ilias->account->getCurrentLanguage()."' ".
                                 "AND NOT lang_default = 1";
                        $r = $this->ilias->db->query($q);
                        $row = $r->fetchRow(DB_FETCHMODE_OBJECT);

                        if ($row)
                        {
                                $this->title = $row->title;
                                $this->desc = $row->description;
                        }
                }

                $ilBench->stop("Core", "ilObject_Constructor_getTranslation");

                $ilBench->stop("Core", "ilObject_read");
        }

Here is the caller graph for this function:

ilObject::requireRegistration (  ) 

Definition at line 1142 of file class.ilObject.php.

        {
                return $this->register;
        }

ilObject::setDescription ( a_desc  ) 

set object description

public

Parameters:
string $a_desc object description

Reimplemented in ilObjQuestionPool, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjSAHSLearningModule, ilObjMediaObject, and ilObjCourse.

Definition at line 374 of file class.ilObject.php.

References ilUtil::shortenText().

Referenced by ilObjRole::assignData(), ilObjNote::createObject(), ilObjSurvey::from_xml(), ilObjTest::from_xml(), ilObjSurveyQuestionPool::importObject(), ilObjLanguage::install(), ilObjRoleFolder::read(), ilObjLanguage::uninstall(), ilObjSurveyQuestionPool::updateMetaData(), ilObjSurvey::updateMetaData(), ilObjTest::updateMetaData(), and ilObjNote::updateNote().

        {
                $this->desc = ilUtil::shortenText($a_desc, $this->max_desc, $this->add_dots);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::setId ( a_id  ) 

set object id public

Parameters:
integer $a_id object id

Reimplemented in ilObjMediaObject, and ilObjCourse.

Definition at line 285 of file class.ilObject.php.

Referenced by ilObjUser::ilObjUser().

        {
                $this->id = $a_id;
        }

Here is the caller graph for this function:

ilObject::setImportId ( a_import_id  ) 

set import id

public

Parameters:
string $a_import_id import id

Reimplemented in ilObjContentObject, ilObjGlossary, and ilObjMediaObject.

Definition at line 396 of file class.ilObject.php.

        {
                $this->import_id = $a_import_id;
        }

ilObject::setObjDataRecord ( a_record  ) 

set object_data record (note: this method should only be called from the ilObjectFactory class)

Parameters:
array $a_record assoc. array from table object_data public
Returns:
integer object id

Definition at line 489 of file class.ilObject.php.

        {
                $this->obj_data_record = $a_record;
        }

ilObject::setOwner ( a_owner  ) 

set object owner

public

Parameters:
integer $a_owner owner id

Definition at line 456 of file class.ilObject.php.

Referenced by create(), and ilObjUser::setActive().

        {
                $this->owner = $a_owner;
        }

Here is the caller graph for this function:

ilObject::setPermissions ( a_parent_ref  ) 

set permissions of object

Parameters:
integer reference_id of parent object public

Definition at line 863 of file class.ilObject.php.

References $ops, $rbacadmin, $rbacreview, getRefId(), and getType().

        {
                global $rbacadmin, $rbacreview;

                $parentRoles = $rbacreview->getParentRoleIds($a_parent_ref);

                foreach ($parentRoles as $parRol)
                {
                        $ops = $rbacreview->getOperationsOfRole($parRol["obj_id"], $this->getType(), $parRol["parent"]);
                        $rbacadmin->grantPermission($parRol["obj_id"], $ops, $this->getRefId());
                }
        }

Here is the call graph for this function:

ilObject::setRefId ( a_id  ) 

set reference id public

Parameters:
integer $a_id reference id

Definition at line 295 of file class.ilObject.php.

        {
                $this->ref_id = $a_id;
                $this->referenced = true;
        }

ilObject::setRegisterMode ( a_bool  ) 

Definition at line 1130 of file class.ilObject.php.

Referenced by ilObjGroup::ilObjGroup().

        {
                $this->register = (bool) $a_bool;
        }

Here is the caller graph for this function:

ilObject::setTitle ( a_title  ) 

set object title

public

Parameters:
string $a_title object title

Reimplemented in ilObjQuestionPool, ilObjMediaObject, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjSAHSLearningModule, ilObjMediaObject, ilObjCourse, and ilObjSurveyQuestionPool.

Definition at line 347 of file class.ilObject.php.

References ilUtil::shortenText().

Referenced by ilObjRole::assignData(), ilObjNote::createObject(), ilObjSurvey::from_xml(), ilObjTest::from_xml(), ilObjTest::importObject(), ilObjRoleFolder::read(), ilObjLanguage::uninstall(), ilObjSurvey::updateMetaData(), ilObjTest::updateMetaData(), and ilObjNote::updateNote().

        {
                if ($a_title == "")
                {
                        $a_title = "NO TITLE";
                }

                $this->title = ilUtil::shortenText($a_title, $this->max_title, $this->add_dots);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::setType ( a_type  ) 

set object type public

Parameters:
integer $a_type object type

Definition at line 326 of file class.ilObject.php.

Referenced by ilObjNote::createObject().

        {
                $this->type = $a_type;
        }

Here is the caller graph for this function:

ilObject::update (  ) 

update object in db

public

Returns:
boolean true on success

Reimplemented in ilObjQuestionPool, ilObjTest, ilObjAssessmentFolder, ilObjAuthSettings, ilObjExercise, ilObjFile, ilObjForum, ilObjMediaObject, ilObjRecoveryFolder, ilObjRole, ilObjStyleSettings, ilObjStyleSheet, ilObjStyleSheetFolder, ilObjSysUserTracking, ilObjUser, ilObj< module_name >, ilObjContentObject, ilObjFileBasedLM, ilObjGlossary, ilObjMediaPool, ilObjSAHSLearningModule, ilObjMediaObject, ilObjCourse, ilObjiLincClassroom, ilObjiLincCourse, ilObjPaymentSettings, ilObjSurvey, and ilObjSurveyQuestionPool.

Definition at line 555 of file class.ilObject.php.

References $q, getDescription(), and getTitle().

Referenced by ilObjLanguage::install(), ilObjLanguage::uninstall(), and ilObjNote::updateNote().

        {

                $q = "UPDATE object_data ".
                        "SET ".
                        "title = '".ilUtil::prepareDBString($this->getTitle())."',".
                        "description = '".ilUtil::prepareDBString($this->getDescription())."', ".
                        "import_id = '".$this->getImportId()."', ".
                        "last_update = now() ".
                        "WHERE obj_id = '".$this->getId()."'";
                $this->ilias->db->query($q);

                // the line ($this->read();) messes up meta data handling: meta data,
                // that is not saved at this time, gets lost, so we query for the dates alone
                //$this->read();
                $q = "SELECT last_update FROM object_data".
                         " WHERE obj_id = '".$this->getId()."'";
                $obj_set = $this->ilias->db->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
                $this->last_update = $obj_rec["last_update"];

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObject::updateOwner (  ) 

update owner of object in db

public

Returns:
boolean true on success

Definition at line 585 of file class.ilObject.php.

References $q.

Referenced by ilObjUser::update().

    {
        $q = "UPDATE object_data ".
            "SET ".
            "owner = '".$this->getOwner()."', ".
            "last_update = now() ".
            "WHERE obj_id = '".$this->getId()."'";
        $this->ilias->db->query($q);

        $q = "SELECT last_update FROM object_data".
             " WHERE obj_id = '".$this->getId()."'";
        $obj_set = $this->ilias->db->query($q);
        $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
        $this->last_update = $obj_rec["last_update"];

        return true;
    }

Here is the caller graph for this function:

ilObject::withReferences (  ) 

determines wehter objects are referenced or not (got ref ids or not)

Definition at line 156 of file class.ilObject.php.

Referenced by ilObjFolder::putInTree().

        {
                // both vars could differ. this method should always return true if one of them is true without changing their status
                return ($this->call_by_reference) ? true : $this->referenced;
        }

Here is the caller graph for this function:


Field Documentation

ilObject::$add_dots

Definition at line 97 of file class.ilObject.php.

ilObject::$create_date

Definition at line 62 of file class.ilObject.php.

Referenced by ilObjNote::saveNote(), and ilObjNote::updateNote().

ilObject::$desc

Definition at line 60 of file class.ilObject.php.

ilObject::$id
ilObject::$ilias
ilObject::$import_id

Definition at line 64 of file class.ilObject.php.

ilObject::$last_update

Definition at line 63 of file class.ilObject.php.

ilObject::$lng
ilObject::$max_desc

Definition at line 91 of file class.ilObject.php.

ilObject::$max_title

Definition at line 85 of file class.ilObject.php.

ilObject::$obj_data_record

object_data record

Definition at line 102 of file class.ilObject.php.

ilObject::$objectList

Definition at line 79 of file class.ilObject.php.

ilObject::$owner

Definition at line 61 of file class.ilObject.php.

Referenced by ilObjSurvey::_addQuestionblock(), and _lookupOwnerName().

ilObject::$ref_id
ilObject::$referenced

Definition at line 72 of file class.ilObject.php.

ilObject::$register = false

Definition at line 65 of file class.ilObject.php.

ilObject::$title
ilObject::$type

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