ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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 ()
 
 update ()
 
 delete ()
 
 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)
 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 27 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 41 of file class.ilObjCourseReference.php.

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

42  {
43  global $ilDB;
44 
45  $this->type = 'crsr';
46  parent::__construct($a_id, $a_call_by_reference);
47  }
__construct(Container $dic, ilPlugin $plugin)
+ 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 
)

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

References isMemberUpdateEnabled().

150  : ?ilObject
151  {
152  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
153  $new_obj->enableMemberUpdate($this->isMemberUpdateEnabled());
154  $new_obj->update();
155  return $new_obj;
156  }
+ Here is the call graph for this function:

◆ create()

ilObjCourseReference::create ( )
Returns

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

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

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

◆ delete()

ilObjCourseReference::delete ( )

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

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

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

◆ enableMemberUpdate()

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

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

Referenced by read().

53  {
54  $this->member_update = $status;
55  }
+ Here is the caller graph for this function:

◆ isMemberUpdateEnabled()

ilObjCourseReference::isMemberUpdateEnabled ( )
Returns
bool

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

References $member_update.

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

60  : bool
61  {
62  return $this->member_update;
63  }
+ 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 69 of file class.ilObjCourseReference.php.

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

Referenced by ilCourseReferencePathInfo\init().

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

◆ read()

ilObjCourseReference::read ( )

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

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

104  : void
105  {
106  parent::read();
107 
108  $query = 'SELECT * FROM crs_reference_settings ' .
109  'WHERE obj_id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
110  $res = $this->db->query($query);
111  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
112  $this->enableMemberUpdate($row->member_update);
113  }
114  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ update()

ilObjCourseReference::update ( )

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

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

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

Field Documentation

◆ $member_update

ilObjCourseReference::$member_update = false
private

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

Referenced by isMemberUpdateEnabled().


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