ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjItemGroup Class Reference

Class ilObjItemGroup. More...

+ Inheritance diagram for ilObjItemGroup:
+ Collaboration diagram for ilObjItemGroup:

Public Member Functions

 __construct ($a_id=0, $a_reference=true)
 Constructor. More...
 
 setId ($a_val)
 Set ID. More...
 
 initType ()
 Init type. More...
 
 setHideTitle ($a_val)
 Set hide title. More...
 
 getHideTitle ()
 Get hide title. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone dependencies. More...
 
- Public Member Functions inherited from ilObject2
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 
 read ()
 Read data from db. More...
 
 getId ()
 
 setId ($a_id)
 
 setRefId ($a_id)
 
 getRefId ()
 
 getType ()
 
 setType ($a_type)
 
 getPresentationTitle ()
 
 getTitle ()
 
 getUntranslatedTitle ()
 
 setTitle ($a_title)
 
 getDescription ()
 
 setDescription ($a_desc)
 
 getLongDescription ()
 
 getImportId ()
 
 setImportId ($a_import_id)
 
 getOwner ()
 
 getOwnerName ()
 
 setOwner ($a_owner)
 
 getCreateDate ()
 
 getLastUpdateDate ()
 
 create ($a_clone_mode=false)
 
 update ()
 
 MDUpdateListener ($a_element)
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 
 putInTree ($a_parent_ref)
 
 setPermissions ($a_parent_ref)
 
 createReference ()
 
 countReferences ()
 
 delete ()
 
 initDefaultRoles ()
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 
 cloneMetaData ($target_obj)
 
 cloneObject ($a_target_id, $a_copy_id=null, $a_omit_tree=false)
 
 cloneDependencies ($a_target_id, $a_copy_id)
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static fixContainerItemGroupRefsAfterCloning ($a_source_container, $a_copy_id)
 Fix container item group references after a container has been cloned. More...
 
static lookupHideTitle ($a_id)
 Lookup hide title. More...
 
- Static Public Member Functions inherited from ilObject2
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupOwnerName ($a_owner_id)
 
static _getIdForImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 
static _lookupTitle ($a_id)
 
static _lookupOwner ($a_id)
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 
static _getLastUpdateOfObjects ($a_objs)
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 
static _resetDeletedDate ($a_ref_id)
 
static _lookupDeletedDate ($a_ref_id)
 
static _writeTitle ($a_obj_id, $a_title)
 
static _writeDescription ($a_obj_id, $a_desc)
 
static _writeImportId ($a_obj_id, $a_import_id)
 
static _lookupType ($a_id, $a_reference=false)
 
static _isInTrash ($a_ref_id)
 
static _hasUntrashedReference ($a_obj_id)
 
static _lookupObjectId ($a_ref_id)
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $a_show_path=true)
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Protected Member Functions

 doRead ()
 Read. More...
 
 doCreate ()
 Creation. More...
 
 doUpdate ()
 Update. More...
 
 doDelete ()
 Deletion. More...
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
 Clone obj item group. More...
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate ()
 
 beforeCreate ()
 
 doUpdate ()
 
 beforeUpdate ()
 
 doMDUpdateListener ($a_element)
 
 beforeMDUpdateListener ($a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 
 beforeCloneObject ()
 

Protected Attributes

 $access_type
 
 $access_begin
 
 $access_end
 
 $access_visibility
 
 $item_data_ar = null
 

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Detailed Description

Class ilObjItemGroup.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 19 of file class.ilObjItemGroup.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjItemGroup::__construct (   $a_id = 0,
  $a_reference = true 
)

Constructor.

Parameters
int$a_idid
bool$a_referenceref id?
Returns

Definition at line 34 of file class.ilObjItemGroup.php.

References $ilDB.

35  {
36  global $tree, $objDefinition, $ilDB;
37 
38  $this->tree = $tree;
39  $this->obj_def = $objDefinition;
40  $this->db = $ilDB;
41 
42  $this->item_data_ar = new ilItemGroupAR();
43 
44  parent::__construct($a_id, $a_reference);
45  }
global $ilDB
Item group active record class.

Member Function Documentation

◆ cloneDependencies()

ilObjItemGroup::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone dependencies.

Parameters

Definition at line 146 of file class.ilObjItemGroup.php.

References $ilLog, and ilObject2\getRefId().

147  {
148  global $ilLog;
149 
150  $ilLog->write(__METHOD__.': Cloning item group dependencies -'.$a_source_id.'-');
151 
152  parent::cloneDependencies($a_target_id,$a_copy_id);
153 
154  include_once('./Modules/ItemGroup/classes/class.ilItemGroupItems.php');
155  $ig_items = new ilItemGroupItems($a_target_id);
156  $ig_items->cloneItems($this->getRefId(), $a_copy_id);
157 
158  return true;
159  }
Item group items.
+ Here is the call graph for this function:

◆ doCloneObject()

ilObjItemGroup::doCloneObject (   $new_obj,
  $a_target_id,
  $a_copy_id = null,
  $a_omit_tree = false 
)
protected

Clone obj item group.

Parameters

Definition at line 134 of file class.ilObjItemGroup.php.

References getHideTitle().

135  {
136  $new_obj->setHideTitle($this->getHideTitle());
137  $new_obj->update();
138  }
getHideTitle()
Get hide title.
+ Here is the call graph for this function:

◆ doCreate()

ilObjItemGroup::doCreate ( )
protected

Creation.

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

References ilObject2\getId().

98  {
99  if($this->getId())
100  {
101  $this->item_data_ar->setId($this->getId());
102  $this->item_data_ar->create();
103  }
104  }
+ Here is the call graph for this function:

◆ doDelete()

ilObjItemGroup::doDelete ( )
protected

Deletion.

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

References ilObject2\getId().

121  {
122  if($this->getId())
123  {
124  $this->item_data_ar->delete();
125  }
126  }
+ Here is the call graph for this function:

◆ doRead()

ilObjItemGroup::doRead ( )
protected

Read.

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

References ilObject2\getId().

90  {
91  $this->item_data_ar = new ilItemGroupAR($this->getId());
92  }
Item group active record class.
+ Here is the call graph for this function:

◆ doUpdate()

ilObjItemGroup::doUpdate ( )
protected

Update.

Definition at line 109 of file class.ilObjItemGroup.php.

References ilObject2\getId().

110  {
111  if($this->getId())
112  {
113  $this->item_data_ar->update();
114  }
115  }
+ Here is the call graph for this function:

◆ fixContainerItemGroupRefsAfterCloning()

static ilObjItemGroup::fixContainerItemGroupRefsAfterCloning (   $a_source_container,
  $a_copy_id 
)
static

Fix container item group references after a container has been cloned.

Parameters

Definition at line 167 of file class.ilObjItemGroup.php.

References $ilLog, ilPageObject\_exists(), ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), and ilPCResources\modifyItemGroupRefIdsByMapping().

Referenced by ilContainer\cloneDependencies().

168  {
169  global $ilLog;
170 
171  $ilLog->write(__METHOD__.': Fix item group references in '.$a_source_container->getType());
172 
173  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
174  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
175  $mappings = $cwo->getMappings();
176 
177  $new_container_ref_id = $mappings[$a_source_container->getRefId()];
178  $ilLog->write(__METHOD__.': 2-'.$new_container_ref_id.'-');
179  $new_container_obj_id = ilObject::_lookupObjId($new_container_ref_id);
180 
181  include_once("./Services/COPage/classes/class.ilPageObject.php");
182  include_once("./Services/Container/classes/class.ilContainerPage.php");
183  $ilLog->write(__METHOD__.': 3'.$new_container_obj_id.'-');
184  if (ilPageObject::_exists("cont", $new_container_obj_id))
185  {
186  $ilLog->write(__METHOD__.': 4');
187  $new_page = new ilContainerPage($new_container_obj_id);
188  $new_page->buildDom();
189  include_once("./Services/COPage/classes/class.ilPCResources.php");
190  ilPCResources::modifyItemGroupRefIdsByMapping($new_page, $mappings);
191  $new_page->update();
192  }
193  $ilLog->write(__METHOD__.': 5');
194  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static modifyItemGroupRefIdsByMapping($a_page, $mappings)
Modify ref ids by mapping.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Container page object.
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHideTitle()

ilObjItemGroup::getHideTitle ( )

Get hide title.

Returns
bool hide title

Definition at line 81 of file class.ilObjItemGroup.php.

Referenced by doCloneObject().

82  {
83  return $this->item_data_ar->getHideTitle();
84  }
+ Here is the caller graph for this function:

◆ initType()

ilObjItemGroup::initType ( )

Init type.

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

62  {
63  $this->type = "itgr";
64  }

◆ lookupHideTitle()

static ilObjItemGroup::lookupHideTitle (   $a_id)
static

Lookup hide title.

Parameters
int$a_idID
Returns
bool

Definition at line 202 of file class.ilObjItemGroup.php.

References $ilDB.

Referenced by ilContainerContentGUI\renderItemGroup().

203  {
204  global $ilDB;
205 
206  $set = $ilDB->query("SELECT hide_title FROM itgr_data ".
207  " WHERE id = ".$ilDB->quote($a_id, "integer")
208  );
209  $rec = $ilDB->fetchAssoc($set);
210  return $rec["hide_title"];
211  }
global $ilDB
+ Here is the caller graph for this function:

◆ setHideTitle()

ilObjItemGroup::setHideTitle (   $a_val)

Set hide title.

Parameters
bool$a_valhide title

Definition at line 71 of file class.ilObjItemGroup.php.

72  {
73  $this->item_data_ar->setHideTitle($a_val);
74  }

◆ setId()

ilObjItemGroup::setId (   $a_val)

Set ID.

Parameters
int$a_valID

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

53  {
54  parent::setId($a_val);
55  $this->item_data_ar->setId($a_val);
56  }

Field Documentation

◆ $access_begin

ilObjItemGroup::$access_begin
protected

Definition at line 22 of file class.ilObjItemGroup.php.

◆ $access_end

ilObjItemGroup::$access_end
protected

Definition at line 23 of file class.ilObjItemGroup.php.

◆ $access_type

ilObjItemGroup::$access_type
protected

Definition at line 21 of file class.ilObjItemGroup.php.

◆ $access_visibility

ilObjItemGroup::$access_visibility
protected

Definition at line 24 of file class.ilObjItemGroup.php.

◆ $item_data_ar

ilObjItemGroup::$item_data_ar = null
protected

Definition at line 25 of file class.ilObjItemGroup.php.


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