ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWorkspaceFolderUserSettings Class Reference

User settings for workspace folders. More...

+ Collaboration diagram for ilWorkspaceFolderUserSettings:

Public Member Functions

 __construct (int $user_id, ilWorkspaceFolderUserSettingsRepository $repo, ilWorkspaceTree $tree=null)
 Constructor. More...
 
 getSortation (int $wfld_id)
 Get Sortation of workspace folder. More...
 
 updateSortation (int $wfld_id, int $sortation)
 Update sortation for workspace folder. More...
 
 getEffectiveSortation (int $wfld_wsp_id)
 Get effective sortation for a workspace folder (next upper context that has sortation > 0) More...
 

Protected Attributes

 $tree
 
 $user_id
 
 $repo
 

Detailed Description

User settings for workspace folders.

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

Definition at line 10 of file class.ilWorkspaceFolderUserSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceFolderUserSettings::__construct ( int  $user_id,
ilWorkspaceFolderUserSettingsRepository  $repo,
ilWorkspaceTree  $tree = null 
)

Constructor.

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

References $repo, $tree, and $user_id.

31  {
32  $this->repo = $repo;
33  $this->user_id = $user_id;
34  $this->tree = ($tree != null)
35  ? $tree
37  }
Tree handler for personal workspace.

Member Function Documentation

◆ getEffectiveSortation()

ilWorkspaceFolderUserSettings::getEffectiveSortation ( int  $wfld_wsp_id)

Get effective sortation for a workspace folder (next upper context that has sortation > 0)

Parameters
int$wfld_wsp_id
Returns
int|mixed

Definition at line 72 of file class.ilWorkspaceFolderUserSettings.php.

References $tree, and ilWorkspaceFolderSorting\SORT_ALPHABETICAL_ASC.

73  {
75 
76  // get path
77  $path = $tree->getPathId($wfld_wsp_id);
78  // get object ids of path
79  $obj_ids = array_map(function ($wsp_id) use ($tree) {
80  return $tree->lookupObjectId($wsp_id);
81  }, $path);
82 
83  // get sortations for object ids
84  $sortations = $this->repo->getSortationMultiple($obj_ids);
85 
86  // search bottom to top first one with sortation > 0
87  foreach (array_reverse($obj_ids) as $id) {
88  if ($sortations[$id] > 0) {
89  return $sortations[$id];
90  }
91  }
93  }

◆ getSortation()

ilWorkspaceFolderUserSettings::getSortation ( int  $wfld_id)

Get Sortation of workspace folder.

Parameters
int$wfld_idfolder object id
Returns
int

Definition at line 44 of file class.ilWorkspaceFolderUserSettings.php.

References ilObject\_lookupType(), ilWorkspaceFolderSorting\SORT_ALPHABETICAL_ASC, and ilWorkspaceFolderSorting\SORT_DERIVED.

44  : int
45  {
46  $sort = $this->repo->getSortation($wfld_id);
47  if ($sort > 0) {
48  return $sort;
49  }
50  if (ilObject::_lookupType($wfld_id) == "wfld") {
52  }
54  }
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ updateSortation()

ilWorkspaceFolderUserSettings::updateSortation ( int  $wfld_id,
int  $sortation 
)

Update sortation for workspace folder.

Parameters
int$wfld_idfolder object id
int$sortation

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

62  {
63  $this->repo->updateSortation($wfld_id, $sortation);
64  }

Field Documentation

◆ $repo

ilWorkspaceFolderUserSettings::$repo
protected

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

Referenced by __construct().

◆ $tree

ilWorkspaceFolderUserSettings::$tree
protected

Definition at line 15 of file class.ilWorkspaceFolderUserSettings.php.

Referenced by __construct(), and getEffectiveSortation().

◆ $user_id

ilWorkspaceFolderUserSettings::$user_id
protected

Definition at line 20 of file class.ilWorkspaceFolderUserSettings.php.

Referenced by __construct().


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