ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjObjectGroup Class Reference

Class ilObjObjectGroup. More...

+ Inheritance diagram for ilObjObjectGroup:
+ Collaboration diagram for ilObjObjectGroup:

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 setId ($a_id)
 
 initType ()
 
 getDisplay ()
 
 setDisplay (string $a_val)
 
 getDisplayWithTitleAndToggleableInitially ()
 
 setDisplayWithTitleAndToggleableInitially (string $a_val)
 
 getListPresentation ()
 
 setListPresentation (string $a_val)
 
 getTileSize ()
 
 setTileSize (int $a_val)
 
 getBehaviour (?bool $stored_value=null)
 
 getShowTitle ()
 
 cloneDependencies (int $a_target_id, int $a_copy_id)
 Clone object dependencies. More...
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 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...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. 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 fixContainerObjectGroupRefsAfterCloning (ilContainer $a_source_container, int $a_copy_id)
 
- 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)
 

Protected Member Functions

 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 doUpdate ()
 
 doDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ilObjectDefinition $obj_def
 
int $access_type
 
int $access_begin
 
int $access_end
 
bool $access_visibility
 
ilObjectGroupAR $item_data_ar = null
 
- 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
 

Additional Inherited Members

- 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
 

Detailed Description

Class ilObjObjectGroup.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilObjObjectGroup::__construct ( int  $a_id = 0,
bool  $a_reference = true 
)

Constructor.

Parameters
int$a_idreference_id or object_id
bool$a_referencetreat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject2.

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

37 {
38 global $DIC;
39
40 $this->log = $DIC["ilLog"];
41 $tree = $DIC->repositoryTree();
42 $objDefinition = $DIC["objDefinition"];
43 $ilDB = $DIC->database();
44
45 $this->tree = $tree;
46 $this->obj_def = $objDefinition;
47 $this->db = $ilDB;
48
49 $this->item_data_ar = new ilObjectGroupAR();
50
51 parent::__construct($a_id, $a_reference);
52 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTree $tree
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneDependencies()

ilObjObjectGroup::cloneDependencies ( int  $target_id,
int  $copy_id 
)

Clone object dependencies.

This method allows to refresh any ref id references to other objects that are affected in the same copy process. Ask ilCopyWizardOptions for the mappings.

Reimplemented from ilObject.

Definition at line 200 of file class.ilObjObjectGroup.php.

200 : bool
201 {
202 parent::cloneDependencies($a_target_id, $a_copy_id);
203
204 (new ilObjectGroupItems($a_target_id))->cloneItems($this->getRefId(), $a_copy_id);
205
206 return true;
207 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilObject\getRefId().

+ Here is the call graph for this function:

◆ doCloneObject()

ilObjObjectGroup::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

Reimplemented from ilObject2.

Definition at line 179 of file class.ilObjObjectGroup.php.

179 : void
180 {
181 assert($new_obj instanceof ilObjObjectGroup);
182 $new_obj->setDisplay($this->getDisplay());
183 $new_obj->setDisplayWithTitleAndToggleableInitially($this->getDisplayWithTitleAndToggleableInitially());
184 $new_obj->setListPresentation($this->getListPresentation());
185 $new_obj->setTileSize($this->getTileSize());
186
187
188 // translations
189 $ot = $this->getObjectProperties()->clonePropertyTranslations($new_obj->getId());
190 if ($ot->getDefaultTitle() !== "") {
191 $new_obj->setTitle($ot->getDefaultTitle());
192 }
193 if ($ot->getDefaultDescription() !== "") {
194 $new_obj->setDescription($ot->getDefaultDescription());
195 }
196
197 $new_obj->update();
198 }
Class ilObjObjectGroup.
setTitle(string $title)
setDescription(string $description)

References getDisplay(), getDisplayWithTitleAndToggleableInitially(), ilObject\getId(), getListPresentation(), ilObject\getObjectProperties(), getTileSize(), ilObject\setDescription(), ilObject\setTitle(), and ilObject2\update().

+ Here is the call graph for this function:

◆ doCreate()

ilObjObjectGroup::doCreate ( bool  $clone_mode = false)
protected

Reimplemented from ilObject2.

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

134 : void
135 {
136 global $DIC;
137
138 if ($this->getId()) {
139 $this->item_data_ar->setId($this->getId());
140 $this->item_data_ar->create();
141 }
142
143 $lng = $DIC->language();
144
145 // add default translation
146 $obj_trans = $this->getObjectProperties()->getPropertyTranslations();
147 $this->getObjectProperties()->storePropertyTranslations(
148 $obj_trans->withLanguage(
149 new Language(
151 $this->getTitle(),
152 $this->getDescription(),
153 true
154 )
155 )
156 );
157 }
getDefaultLanguage()
Return default language.
ilLanguage $lng

References $DIC, ilObject\$lng, ilLanguage\getDefaultLanguage(), ilObject\getId(), and ilObject\getObjectProperties().

+ Here is the call graph for this function:

◆ doDelete()

ilObjObjectGroup::doDelete ( )
protected

Reimplemented from ilObject2.

Definition at line 172 of file class.ilObjObjectGroup.php.

172 : void
173 {
174 if ($this->getId()) {
175 $this->item_data_ar->delete();
176 }
177 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ doRead()

ilObjObjectGroup::doRead ( )
protected

Reimplemented from ilObject2.

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

120 : void
121 {
122 $this->item_data_ar = new ilObjectGroupAR($this->getId());
123 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ doUpdate()

ilObjObjectGroup::doUpdate ( )
protected

Reimplemented from ilObject2.

Definition at line 159 of file class.ilObjObjectGroup.php.

159 : void
160 {
161 if ($this->getId()) {
162 $this->item_data_ar->update();
163
164 $this->getObjectProperties()->storePropertyTranslations(
165 $this->getObjectProperties()->getPropertyTranslations()
166 ->withDefaultTitle($this->getTitle())
167 ->withDefaultDescription($this->getLongDescription())
168 );
169 }
170 }
getLongDescription()
get object long description (stored in object_description)

References ilObject\getId(), ilObject\getLongDescription(), ilObject\getObjectProperties(), and ilObject\getTitle().

+ Here is the call graph for this function:

◆ fixContainerObjectGroupRefsAfterCloning()

static ilObjObjectGroup::fixContainerObjectGroupRefsAfterCloning ( ilContainer  $a_source_container,
int  $a_copy_id 
)
static

Definition at line 209 of file class.ilObjObjectGroup.php.

212 : void {
213 global $DIC;
214
215 $ilLog = $DIC["ilLog"];
216
217 $ilLog->info('Fix object group references in ' . $a_source_container->getType());
218
219 $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
220 $mappings = $cwo->getMappings();
221
222 $new_container_ref_id = $mappings[$a_source_container->getRefId()];
223 $ilLog->info('2-' . $new_container_ref_id . '-');
224 $new_container_obj_id = ilObject::_lookupObjId($new_container_ref_id);
225
226 $ilLog->info('3' . $new_container_obj_id . '-');
227 if (ilPageObject::_exists("cont", $new_container_obj_id)) {
228 $ilLog->info('4');
229 $new_page = new ilContainerPage($new_container_obj_id);
230 $new_page->buildDom();
232 $new_page->update();
233 }
234 $ilLog->info('5');
235 }
Container page object.
static _getInstance(int $a_copy_id)
static _lookupObjId(int $ref_id)
static modifyItemGroupRefIdsByMapping(ilPageObject $a_page, array $mappings)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.

Referenced by ilContainer\cloneDependencies().

+ Here is the caller graph for this function:

◆ getBehaviour()

ilObjObjectGroup::getBehaviour ( ?bool  $stored_value = null)

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

References ilObjectGroupBehaviour\ALWAYS_OPEN, ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE, ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN, ilObjectGroupBehaviour\EXPANDABLE_CLOSED, ilObjectGroupBehaviour\EXPANDABLE_OPEN, getDisplay(), and getDisplayWithTitleAndToggleableInitially().

+ Here is the call graph for this function:

◆ getDisplay()

ilObjObjectGroup::getDisplay ( )

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

65 : string
66 {
67 return $this->item_data_ar->getDisplay();
68 }

Referenced by doCloneObject(), getBehaviour(), and getShowTitle().

+ Here is the caller graph for this function:

◆ getDisplayWithTitleAndToggleableInitially()

ilObjObjectGroup::getDisplayWithTitleAndToggleableInitially ( )

Definition at line 75 of file class.ilObjObjectGroup.php.

75 : string
76 {
77 return $this->item_data_ar->getDisplayWithTitleAndToggleableInitially();
78 }

Referenced by doCloneObject(), and getBehaviour().

+ Here is the caller graph for this function:

◆ getListPresentation()

ilObjObjectGroup::getListPresentation ( )

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

85 : string
86 {
87 return $this->item_data_ar->getListPresentation();
88 }

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ getShowTitle()

ilObjObjectGroup::getShowTitle ( )

Definition at line 125 of file class.ilObjObjectGroup.php.

125 : bool
126 {
127 return in_array(
128 $this->getDisplay(),
130 true
131 );
132 }

References ilObjectGroupAR\DISPLAY_WITH_TITLE, ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE, and getDisplay().

+ Here is the call graph for this function:

◆ getTileSize()

ilObjObjectGroup::getTileSize ( )

Definition at line 95 of file class.ilObjObjectGroup.php.

95 : int
96 {
97 return $this->item_data_ar->getTileSize();
98 }

Referenced by doCloneObject().

+ Here is the caller graph for this function:

◆ initType()

ilObjObjectGroup::initType ( )

Reimplemented from ilObject2.

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

60 : void
61 {
62 $this->type = "obgr";
63 }

◆ setDisplay()

ilObjObjectGroup::setDisplay ( string  $a_val)

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

70 : void
71 {
72 $this->item_data_ar->setDisplay($a_val);
73 }

◆ setDisplayWithTitleAndToggleableInitially()

ilObjObjectGroup::setDisplayWithTitleAndToggleableInitially ( string  $a_val)

Definition at line 80 of file class.ilObjObjectGroup.php.

80 : void
81 {
82 $this->item_data_ar->setDisplayWithTitleAndToggleableInitially($a_val);
83 }

◆ setId()

ilObjObjectGroup::setId (   $a_id)

Definition at line 54 of file class.ilObjObjectGroup.php.

54 : void
55 {
56 parent::setId($a_id);
57 $this->item_data_ar->setId($a_id);
58 }

◆ setListPresentation()

ilObjObjectGroup::setListPresentation ( string  $a_val)

Definition at line 90 of file class.ilObjObjectGroup.php.

90 : void
91 {
92 $this->item_data_ar->setListPresentation($a_val);
93 }

◆ setTileSize()

ilObjObjectGroup::setTileSize ( int  $a_val)

Definition at line 100 of file class.ilObjObjectGroup.php.

100 : void
101 {
102 $this->item_data_ar->setTileSize($a_val);
103 }

Field Documentation

◆ $access_begin

int ilObjObjectGroup::$access_begin
protected

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

◆ $access_end

int ilObjObjectGroup::$access_end
protected

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

◆ $access_type

int ilObjObjectGroup::$access_type
protected

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

◆ $access_visibility

bool ilObjObjectGroup::$access_visibility
protected

Definition at line 31 of file class.ilObjObjectGroup.php.

◆ $item_data_ar

ilObjectGroupAR ilObjObjectGroup::$item_data_ar = null
protected

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

◆ $obj_def

ilObjectDefinition ilObjObjectGroup::$obj_def
protected

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


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