ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjCourseReference Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjCourseReference:
+ Collaboration diagram for ilObjCourseReference:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor. More...
 
 enableMemberUpdate (bool $status)
 
 isMemberUpdateEnabled ()
 
 create ()
 
 read ()
 
 update ()
 
 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!!
Returns
bool true if object was removed completely; false if only a references was removed
More...
 
 cloneObject (int $a_target_id, int $a_copy_id=0, bool $a_omit_tree=false)
 
- Public Member Functions inherited from ilContainerReference
 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 getTargetId ()
 
 setTargetId (int $a_target_id)
 
 setTargetRefId (int $a_id)
 
 getTargetRefId ()
 
 getTitleType ()
 
 setTitleType (int $type)
 
 read ()
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 update ()
 
 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!! More...
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 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!! More...
 
 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id, int $new_obj_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static lookupMemberUpdateEnabled (int $obj_id)
 
- Static Public Member Functions inherited from ilContainerReference
static _lookupTargetId (int $a_obj_id)
 
static _lookupTargetRefId (int $a_obj_id)
 
static _lookupTitle (int $obj_id)
 
static _lookupTargetTitle (int $a_obj_id)
 
static _lookupSourceId (int $a_target_id)
 
static _lookupSourceIds (int $a_target_id)
 Get ids of all container references that target the object with the given id. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Private Attributes

 $member_update = false
 

Additional Inherited Members

- Data Fields inherited from ilContainerReference
const TITLE_TYPE_REUSE = 1
 
const TITLE_TYPE_CUSTOM = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Attributes inherited from ilContainerReference
ilObjUser $user
 
int $target_id = null
 
int $target_ref_id = null
 
int $title_type = self::TITLE_TYPE_REUSE
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

\

Definition at line 28 of file class.ilObjCourseReference.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjCourseReference::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor.

Parameters
int$a_idreference id
bool$a_call_by_reference
Returns
void

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

43 {
44 global $ilDB;
45
46 $this->type = 'crsr';
47 parent::__construct($a_id, $a_call_by_reference);
48 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $ilDB, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneObject()

ilObjCourseReference::cloneObject ( int  $a_target_id,
int  $a_copy_id = 0,
bool  $a_omit_tree = false 
)

Reimplemented from ilContainerReference.

Definition at line 151 of file class.ilObjCourseReference.php.

151 : ?ilObject
152 {
153 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
154 $new_obj->enableMemberUpdate($this->isMemberUpdateEnabled());
155 $new_obj->update();
156
157 $lp_settings = new ilLPObjSettings($this->getId());
158 $lp_settings->cloneSettings($new_obj->getId());
159
160 return $new_obj;
161 }
Class ilObject Basic functions for all objects.

References ilObject\getId(), and isMemberUpdateEnabled().

+ Here is the call graph for this function:

◆ create()

ilObjCourseReference::create ( )
Returns
note: title, description and type should be set when this function is called

Reimplemented from ilObject.

Definition at line 89 of file class.ilObjCourseReference.php.

89 : int
90 {
91 $id = parent::create();
92
93 $query = 'INSERT INTO crs_reference_settings (obj_id, member_update ) ' .
94 'VALUES ( ' .
95 $this->db->quote($id, ilDBConstants::T_INTEGER) . ', ' .
96 $this->db->quote((int) $this->isMemberUpdateEnabled(), ilDBConstants::T_INTEGER) . ' ' .
97 ')';
98 $this->db->manipulate($query);
99 return $id;
100 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, isMemberUpdateEnabled(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ delete()

ilObjCourseReference::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!!

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

Reimplemented from ilContainerReference.

Definition at line 136 of file class.ilObjCourseReference.php.

136 : bool
137 {
138 if (!parent::delete()) {
139 return false;
140 }
141 $query = 'DELETE FROM crs_reference_settings ' .
142 'WHERE obj_id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
143 $this->db->manipulate($query);
144 return true;
145 }

References ilObject\getId(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ enableMemberUpdate()

ilObjCourseReference::enableMemberUpdate ( bool  $status)
Parameters
bool$status

Definition at line 53 of file class.ilObjCourseReference.php.

54 {
55 $this->member_update = $status;
56 }

Referenced by read().

+ Here is the caller graph for this function:

◆ isMemberUpdateEnabled()

ilObjCourseReference::isMemberUpdateEnabled ( )
Returns
bool

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

61 : bool
62 {
64 }

References $member_update.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ lookupMemberUpdateEnabled()

static ilObjCourseReference::lookupMemberUpdateEnabled ( int  $obj_id)
static
Parameters
int$obj_id
Returns
bool

Definition at line 70 of file class.ilObjCourseReference.php.

70 : bool
71 {
72 global $DIC;
73
74 $db = $DIC->database();
75
76 $query = 'select member_update from crs_reference_settings where ' .
77 'obj_id = ' . $db->quote($obj_id, ilDBConstants::T_INTEGER);
78 $res = $db->query($query);
79 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
80 return (bool) $row->member_update;
81 }
82 return false;
83 }
ilDBInterface $db
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26

References ilObject\$db, $DIC, $res, ilDBConstants\FETCHMODE_OBJECT, ilDBInterface\query(), ilDBInterface\quote(), and ilDBConstants\T_INTEGER.

Referenced by ilCourseReferencePathInfo\init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjCourseReference::read ( )

Reimplemented from ilContainerReference.

Definition at line 105 of file class.ilObjCourseReference.php.

105 : void
106 {
107 parent::read();
108
109 $query = 'SELECT * FROM crs_reference_settings ' .
110 'WHERE obj_id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
111 $res = $this->db->query($query);
112 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
113 $this->enableMemberUpdate($row->member_update);
114 }
115 }

References $res, enableMemberUpdate(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ update()

ilObjCourseReference::update ( )

Reimplemented from ilContainerReference.

Definition at line 120 of file class.ilObjCourseReference.php.

120 : bool
121 {
122 parent::update();
123 $query = 'UPDATE crs_reference_settings ' .
124 'SET member_update = ' . $this->db->quote((int) $this->isMemberUpdateEnabled(), ilDBConstants::T_INTEGER) . ' ' .
125 'WHERE obj_id = ' . $this->db->quote((int) $this->getId(), ilDBConstants::T_INTEGER);
126 $this->db->manipulate($query);
127
128 ilLoggerFactory::getLogger('crs')->info($query);
129
130 return true;
131 }
static getLogger(string $a_component_id)
Get component logger.

References ilObject\getId(), ilLoggerFactory\getLogger(), isMemberUpdateEnabled(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

Field Documentation

◆ $member_update

ilObjCourseReference::$member_update = false
private

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

Referenced by isMemberUpdateEnabled().


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