ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 setBehaviour ($a_val)
 Set behaviour (see ilItemGroupBehaviour) More...
 
 getBehaviour ()
 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...
 
 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 ()
 
 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 lookupBehaviour ($a_id)
 Lookup behaviour. 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 ()
 

Static Protected Member Functions

static lookup ($a_id, $a_key)
 Lookup hide title. More...
 

Protected Attributes

 $obj_def
 
 $access_type
 
 $access_begin
 
 $access_end
 
 $access_visibility
 
 $item_data_ar = null
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $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 39 of file class.ilObjItemGroup.php.

References $DIC, $ilDB, ilObject\$objDefinition, and ilObject\$tree.

40  {
41  global $DIC;
42 
43  $this->log = $DIC["ilLog"];
44  $tree = $DIC->repositoryTree();
45  $objDefinition = $DIC["objDefinition"];
46  $ilDB = $DIC->database();
47 
48  $this->tree = $tree;
49  $this->obj_def = $objDefinition;
50  $this->db = $ilDB;
51 
52  $this->item_data_ar = new ilItemGroupAR();
53 
54  parent::__construct($a_id, $a_reference);
55  }
global $DIC
Definition: saml.php:7
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 175 of file class.ilObjItemGroup.php.

References $ilLog, ilObject\$log, and ilObject2\getRefId().

176  {
177  $ilLog = $this->log;
178 
179  $ilLog->write(__METHOD__ . ': Cloning item group dependencies -' . $a_source_id . '-');
180 
181  parent::cloneDependencies($a_target_id, $a_copy_id);
182 
183  include_once('./Modules/ItemGroup/classes/class.ilItemGroupItems.php');
184  $ig_items = new ilItemGroupItems($a_target_id);
185  $ig_items->cloneItems($this->getRefId(), $a_copy_id);
186 
187  return true;
188  }
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
ilObjItemGroup$new_obj
int$a_target_id
string$a_copy_id
bool$a_omit_tree

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

References getBehaviour(), and getHideTitle().

163  {
164  $new_obj->setHideTitle($this->getHideTitle());
165  $new_obj->setBehaviour($this->getBehaviour());
166  $new_obj->update();
167  }
getBehaviour()
Get hide title.
getHideTitle()
Get hide title.
+ Here is the call graph for this function:

◆ doCreate()

ilObjItemGroup::doCreate ( )
protected

Creation.

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

References ilObject2\getId().

128  {
129  if ($this->getId()) {
130  $this->item_data_ar->setId($this->getId());
131  $this->item_data_ar->create();
132  }
133  }
+ Here is the call graph for this function:

◆ doDelete()

ilObjItemGroup::doDelete ( )
protected

Deletion.

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

References ilObject2\getId().

149  {
150  if ($this->getId()) {
151  $this->item_data_ar->delete();
152  }
153  }
+ Here is the call graph for this function:

◆ doRead()

ilObjItemGroup::doRead ( )
protected

Read.

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

References ilObject2\getId().

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

◆ doUpdate()

ilObjItemGroup::doUpdate ( )
protected

Update.

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

References ilObject2\getId().

139  {
140  if ($this->getId()) {
141  $this->item_data_ar->update();
142  }
143  }
+ 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 196 of file class.ilObjItemGroup.php.

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

Referenced by ilContainer\cloneDependencies().

197  {
198  global $DIC;
199 
200  $ilLog = $DIC["ilLog"];
201 
202  $ilLog->write(__METHOD__ . ': Fix item group references in ' . $a_source_container->getType());
203 
204  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
205  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
206  $mappings = $cwo->getMappings();
207 
208  $new_container_ref_id = $mappings[$a_source_container->getRefId()];
209  $ilLog->write(__METHOD__ . ': 2-' . $new_container_ref_id . '-');
210  $new_container_obj_id = ilObject::_lookupObjId($new_container_ref_id);
211 
212  include_once("./Services/COPage/classes/class.ilPageObject.php");
213  include_once("./Services/Container/classes/class.ilContainerPage.php");
214  $ilLog->write(__METHOD__ . ': 3' . $new_container_obj_id . '-');
215  if (ilPageObject::_exists("cont", $new_container_obj_id)) {
216  $ilLog->write(__METHOD__ . ': 4');
217  $new_page = new ilContainerPage($new_container_obj_id);
218  $new_page->buildDom();
219  include_once("./Services/COPage/classes/class.ilPCResources.php");
220  ilPCResources::modifyItemGroupRefIdsByMapping($new_page, $mappings);
221  $new_page->update();
222  }
223  $ilLog->write(__METHOD__ . ': 5');
224  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
global $DIC
Definition: saml.php:7
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:

◆ getBehaviour()

ilObjItemGroup::getBehaviour ( )

Get hide title.

Returns
int behaviour

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

Referenced by doCloneObject().

112  {
113  return $this->item_data_ar->getBehaviour();
114  }
+ Here is the caller graph for this function:

◆ getHideTitle()

ilObjItemGroup::getHideTitle ( )

Get hide title.

Returns
bool hide title

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

Referenced by doCloneObject().

92  {
93  return $this->item_data_ar->getHideTitle();
94  }
+ Here is the caller graph for this function:

◆ initType()

ilObjItemGroup::initType ( )

Init type.

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

72  {
73  $this->type = "itgr";
74  }

◆ lookup()

static ilObjItemGroup::lookup (   $a_id,
  $a_key 
)
staticprotected

Lookup hide title.

Parameters
int$a_idID
Returns
bool

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

References $DIC, and $ilDB.

255  {
256  global $DIC;
257 
258  $ilDB = $DIC->database();
259 
260  $set = $ilDB->query(
261  "SELECT " . $a_key . " FROM itgr_data " .
262  " WHERE id = " . $ilDB->quote($a_id, "integer")
263  );
264  $rec = $ilDB->fetchAssoc($set);
265  return $rec[$a_key];
266  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ lookupBehaviour()

static ilObjItemGroup::lookupBehaviour (   $a_id)
static

Lookup behaviour.

Parameters
int$a_idID
Returns
int

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

Referenced by ilContainerContentGUI\renderItemGroup().

244  {
245  return self::lookup($a_id, "behaviour");
246  }
+ Here is the caller graph for this function:

◆ lookupHideTitle()

static ilObjItemGroup::lookupHideTitle (   $a_id)
static

Lookup hide title.

Parameters
int$a_idID
Returns
bool

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

Referenced by ilContainerContentGUI\renderItemGroup().

233  {
234  return self::lookup($a_id, "hide_title");
235  }
+ Here is the caller graph for this function:

◆ setBehaviour()

ilObjItemGroup::setBehaviour (   $a_val)

Set behaviour (see ilItemGroupBehaviour)

Parameters
int$a_valbehaviour

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

102  {
103  $this->item_data_ar->setBehaviour($a_val);
104  }

◆ setHideTitle()

ilObjItemGroup::setHideTitle (   $a_val)

Set hide title.

Parameters
bool$a_valhide title

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

82  {
83  $this->item_data_ar->setHideTitle($a_val);
84  }

◆ setId()

ilObjItemGroup::setId (   $a_val)

Set ID.

Parameters
int$a_valID

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

63  {
64  parent::setId($a_val);
65  $this->item_data_ar->setId($a_val);
66  }

Field Documentation

◆ $access_begin

ilObjItemGroup::$access_begin
protected

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

◆ $access_end

ilObjItemGroup::$access_end
protected

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

◆ $access_type

ilObjItemGroup::$access_type
protected

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

◆ $access_visibility

ilObjItemGroup::$access_visibility
protected

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

◆ $item_data_ar

ilObjItemGroup::$item_data_ar = null
protected

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

◆ $obj_def

ilObjItemGroup::$obj_def
protected

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


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