ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Bibliographic\Field\Table\AssignedObjectsTable Class Reference
+ Collaboration diagram for ILIAS\Bibliographic\Field\Table\AssignedObjectsTable:

Public Member Functions

 __construct (object $parent_obj, array $objects, int $skill_id=0, int $tref_id=0, int $profile_id=0)
 
 getComponent ()
 

Protected Member Functions

 getColumns ()
 
 getDataRetrieval ()
 

Protected Attributes

ilLanguage $lng
 
ilTree $tree
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
ServerRequestInterface $request
 
object $parent_obj
 
array $objects = []
 
int $skill_id = 0
 
int $tref_id = 0
 
int $profile_id = 0
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::__construct ( object  $parent_obj,
array  $objects,
int  $skill_id = 0,
int  $tref_id = 0,
int  $profile_id = 0 
)

Definition at line 43 of file class.AssignedObjectsTable.php.

References $DIC, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$objects, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$parent_obj, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$profile_id, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$skill_id, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$tref_id, and ILIAS\Repository\lng().

Referenced by ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getDataRetrieval().

49  {
50  global $DIC;
51 
52  $this->lng = $DIC->language();
53  $this->tree = $DIC->repositoryTree();
54  $this->ui_fac = $DIC->ui()->factory();
55  $this->ui_ren = $DIC->ui()->renderer();
56  $this->request = $DIC->http()->request();
57 
58  $this->parent_obj = $parent_obj;
59  $this->objects = $objects;
60  $this->skill_id = $skill_id;
61  $this->tref_id = $tref_id;
62  $this->profile_id = $profile_id;
63  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ getColumns()

ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::getColumns ( )
protected

Definition at line 84 of file class.AssignedObjectsTable.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getComponent().

84  : array
85  {
86  $columns = [
87  "type" => $this->ui_fac->table()->column()->statusIcon($this->lng->txt("type"))
88  ->withIsSortable(false),
89  "title" => $this->ui_fac->table()->column()->text($this->lng->txt("title")),
90  "path" => $this->ui_fac->table()->column()->text($this->lng->txt("path"))
91  ->withIsSortable(false)
92  ];
93 
94  return $columns;
95  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponent()

ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::getComponent ( )

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

References ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getColumns(), ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getDataRetrieval(), and ILIAS\Repository\lng().

65  : UI\Component\Table\Data
66  {
67  $columns = $this->getColumns();
68  $data_retrieval = $this->getDataRetrieval();
69 
70  $table = $this->ui_fac->table()
71  ->data($data_retrieval, $this->lng->txt("skmg_assigned_objects"), $columns)
72  ->withId(
73  self::class . "_" .
74  $this->parent_obj::class . "_" .
75  $this->skill_id . "_" .
76  $this->tref_id . "_" .
77  $this->profile_id
78  )
79  ->withRequest($this->request);
80 
81  return $table;
82  }
+ Here is the call graph for this function:

◆ getDataRetrieval()

ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::getDataRetrieval ( )
protected

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

References ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$lng, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$objects, $path, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$tree, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$ui_fac, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\$ui_ren, ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\__construct(), ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\Repository\lng(), and null.

Referenced by ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getComponent().

97  : UI\Component\Table\DataRetrieval
98  {
99  $data_retrieval = new class (
100  $this->lng,
103  $this->tree,
105  ) implements UI\Component\Table\DataRetrieval {
106  use TableRecords;
107 
108  public function __construct(
109  protected \ilLanguage $lng,
110  protected UI\Factory $ui_fac,
111  protected UI\Renderer $ui_ren,
112  protected \ilTree $tree,
113  protected array $objects
114  ) {
115  }
116 
117  public function getRows(
118  UI\Component\Table\DataRowBuilder $row_builder,
119  array $visible_column_ids,
120  Data\Range $range,
121  Data\Order $order,
122  ?array $filter_data,
123  ?array $additional_parameters
124  ): \Generator {
125  $records = $this->getRecords($range, $order);
126  foreach ($records as $idx => $record) {
127  $row_id = (string) $record["obj_id"];
128 
129  yield $row_builder->buildDataRow($row_id, $record);
130  }
131  }
132 
133  public function getTotalRowCount(
134  ?array $filter_data,
135  ?array $additional_parameters
136  ): ?int {
137  return count($this->getRecords());
138  }
139 
140  protected function getRecords(?Data\Range $range = null, ?Data\Order $order = null): array
141  {
142  $records = [];
143  $i = 0;
144  foreach ($this->objects as $obj_id) {
145  $obj_ref_id = \ilObject::_getAllReferences($obj_id);
146  $obj_ref_id = end($obj_ref_id);
147 
148  if (!$obj_ref_id) {
149  continue;
150  }
151 
152  $records[$i]["obj_id"] = $obj_id;
153  $records[$i]["title"] = \ilObject::_lookupTitle($obj_id);
154 
155  $obj_type = \ilObject::_lookupType($obj_id);
156  $icon = $this->ui_fac->symbol()->icon()->standard(
157  $obj_type,
158  $this->lng->txt("icon") . " " . $this->lng->txt($obj_type),
159  "medium"
160  );
161  $records[$i]["type"] = $icon;
162 
163  $obj_ref_id_parent = $this->tree->getParentId($obj_ref_id);
164  $path = new \ilPathGUI();
165  $records[$i]["path"] = $path->getPath($this->tree->getParentId($obj_ref_id_parent), $obj_ref_id);
166 
167  $i++;
168  }
169 
170  if ($order) {
171  $records = $this->orderRecords($records, $order);
172  }
173 
174  if ($range) {
175  $records = $this->limitRecords($records, $range);
176  }
177 
178  return $records;
179  }
180  };
181 
182  return $data_retrieval;
183  }
static _getAllReferences(int $id)
get all reference ids for object ID
$path
Definition: ltiservices.php:29
__construct(object $parent_obj, array $objects, int $skill_id=0, int $tref_id=0, int $profile_id=0)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$lng
protected

◆ $objects

array ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$objects = []
protected

◆ $parent_obj

object ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$parent_obj
protected

◆ $profile_id

int ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$profile_id = 0
protected

◆ $request

ServerRequestInterface ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$request
protected

Definition at line 36 of file class.AssignedObjectsTable.php.

◆ $skill_id

int ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$skill_id = 0
protected

◆ $tree

ilTree ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$tree
protected

◆ $tref_id

int ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$tref_id = 0
protected

◆ $ui_fac

UI Factory ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$ui_fac
protected

◆ $ui_ren

UI Renderer ILIAS\Bibliographic\Field\Table\AssignedObjectsTable::$ui_ren
protected

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