ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Test\Participants\ParticipantTable Class Reference
+ Inheritance diagram for ILIAS\Test\Participants\ParticipantTable:
+ Collaboration diagram for ILIAS\Test\Participants\ParticipantTable:

Public Member Functions

 __construct (private readonly UIFactory $ui_factory, private readonly \ilUIService $ui_service, private readonly Language $lng, private readonly \ilTestAccess $test_access, private readonly RequestDataCollector $test_request, private readonly \ilTestParticipantAccessFilterFactory $participant_access_filter, private readonly ParticipantRepository $repository, private readonly ResultsDataFactory $results_data_factory, private readonly ResultsPresentationSettings $results_presentation_settings, private readonly \ilObjUser $current_user, private readonly \ilObjTest $test_object, private readonly ParticipantTableActions $table_actions)
 
 execute (URLBuilder $url_builder)
 
 getComponents (URLBuilder $url_builder, string $filter_url)
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
- Public Member Functions inherited from ILIAS\UI\Component\Table\DataRetrieval
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 

Private Member Functions

 acquireParameters ($url_builder)
 
 getPostLoadFilters ()
 
 getPostLoadOrderFields ()
 
 getFilterComponent (string $action, ServerRequestInterface $request)
 
 getFilterFields (FieldFactory $field_factory)
 
 getTableComponent (ServerRequestInterface $request, ?array $filter)
 
 getColumns ()
 
 loadRecords (?array $filter, Order $order)
 
 getViewControlledRecords (?array $filter_data, Range $range, Order $order)
 
 filterRecords (iterable $records, ?array $filter_data)
 
 matchFilter (Participant $record, ?array $filter)
 
 sortRecords (iterable $records, Order $order)
 
 limitRecords (array $records, Range $range)
 

Private Attributes

const ID = 'pt'
 
iterable $records = null
 

Detailed Description

Definition at line 39 of file ParticipantTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Participants\ParticipantTable::__construct ( private readonly UIFactory  $ui_factory,
private readonly \ilUIService  $ui_service,
private readonly Language  $lng,
private readonly \ilTestAccess  $test_access,
private readonly RequestDataCollector  $test_request,
private readonly \ilTestParticipantAccessFilterFactory  $participant_access_filter,
private readonly ParticipantRepository  $repository,
private readonly ResultsDataFactory  $results_data_factory,
private readonly ResultsPresentationSettings  $results_presentation_settings,
private readonly \ilObjUser  $current_user,
private readonly \ilObjTest  $test_object,
private readonly ParticipantTableActions  $table_actions 
)

Definition at line 44 of file ParticipantTable.php.

57  {
58  }

Member Function Documentation

◆ acquireParameters()

◆ execute()

ILIAS\Test\Participants\ParticipantTable::execute ( URLBuilder  $url_builder)

Definition at line 60 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\acquireParameters().

60  : ?Modal
61  {
62  return $this->table_actions->execute(...$this->acquireParameters($url_builder));
63  }
+ Here is the call graph for this function:

◆ filterRecords()

ILIAS\Test\Participants\ParticipantTable::filterRecords ( iterable  $records,
?array  $filter_data 
)
private

Definition at line 474 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\matchFilter().

Referenced by ILIAS\Test\Participants\ParticipantTable\getViewControlledRecords().

474  : iterable
475  {
476  foreach ($records as $record) {
477  if ($this->matchFilter($record, $filter_data)) {
478  yield $record;
479  }
480  }
481  }
matchFilter(Participant $record, ?array $filter)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumns()

ILIAS\Test\Participants\ParticipantTable::getColumns ( )
private
Returns
array<string, Column>

Definition at line 335 of file ParticipantTable.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\Test\Participants\ParticipantTable\getTableComponent().

335  : array
336  {
337  $column_factory = $this->ui_factory->table()->column();
338 
339  $columns = [
340  'name' => $column_factory->text($this->lng->txt('name'))
341  ->withIsSortable(!$this->test_object->getAnonymity())
342  ];
343  if (!$this->test_object->getAnonymity()) {
344  $columns['login'] = $column_factory->text($this->lng->txt('login'))->withIsSortable(true);
345  }
346 
347  $columns += [
348  'matriculation' => $column_factory->text($this->lng->txt('matriculation'))
349  ->withIsOptional(true, false)
350  ->withIsSortable(true),
351  'ip_range' => $column_factory->text($this->lng->txt('client_ip_range'))
352  ->withIsOptional(true, false)
353  ->withIsSortable(true),
354  'attempt_started_at' => $column_factory->date(
355  $this->lng->txt('tst_attempt_started'),
356  $this->current_user->getDateTimeFormat()
357  )->withIsSortable(true),
358  'total_time_on_task' => $column_factory->text($this->lng->txt('working_time'))
359  ->withIsOptional(true, false),
360  'total_attempts' => $column_factory->number($this->lng->txt('total_attempts'))
361  ->withIsOptional(true, false)
362  ->withIsSortable(true),
363  ];
364 
365  if ($this->test_object->getEnableProcessingTime()) {
366  $columns['extra_time'] = $column_factory->text($this->lng->txt('extratime'))
367  ->withIsOptional(true, false);
368  $columns['total_duration'] = $column_factory->text($this->lng->txt('total_duration'))
369  ->withIsOptional(true, false);
370  $columns['remaining_duration'] = $column_factory->text($this->lng->txt('remaining_duration'))
371  ->withIsOptional(true);
372  }
373 
374  $columns['status_of_attempt'] = $column_factory->text($this->lng->txt('status_of_attempt'))
375  ->withIsSortable(true);
376 
377  if ($this->test_object->getMainSettings()->getTestBehaviourSettings()->getExamIdInTestAttemptEnabled()) {
378  $columns['id_of_attempt'] = $column_factory->text($this->lng->txt('exam_id_of_attempt'))
379  ->withIsOptional(true, false)
380  ->withIsSortable(true);
381  }
382 
383  if ($this->test_access->checkParticipantsResultsAccess()) {
384  $columns['reached_points'] = $column_factory->text($this->lng->txt('tst_reached_points'))
385  ->withIsSortable(true);
386  $columns['nr_of_answered_questions'] = $column_factory->text($this->lng->txt('tst_answered_questions'))
387  ->withIsOptional(true, false)
388  ->withIsSortable(true);
389  $columns['percent_of_available_points'] = $column_factory->number($this->lng->txt('tst_percent_solved'))
390  ->withUnit('%')
391  ->withIsOptional(true, false)
392  ->withIsSortable(true);
393  $columns['test_passed'] = $column_factory->boolean(
394  $this->lng->txt('tst_passed'),
395  $this->ui_factory->symbol()->icon()->custom(
396  'assets/images/standard/icon_checked.svg',
397  $this->lng->txt('yes'),
398  'small'
399  ),
400  $this->ui_factory->symbol()->icon()->custom(
401  'assets/images/standard/icon_unchecked.svg',
402  $this->lng->txt('no'),
403  'small'
404  )
405  )->withIsSortable(true)
406  ->withOrderingLabels(
407  "{$this->lng->txt('tst_passed')}, {$this->lng->txt('yes')} {$this->lng->txt('order_option_first')}",
408  "{$this->lng->txt('tst_passed')}, {$this->lng->txt('no')} {$this->lng->txt('order_option_first')}"
409  );
410  $columns['mark'] = $column_factory->text($this->lng->txt('tst_mark'))
411  ->withIsOptional(true, false)
412  ->withIsSortable(true);
413  }
414 
415  $columns['last_access'] = $column_factory->date(
416  $this->lng->txt('last_access'),
417  $this->current_user->getDateTimeFormat()
418  );
419 
420  return $columns;
421  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponents()

ILIAS\Test\Participants\ParticipantTable::getComponents ( URLBuilder  $url_builder,
string  $filter_url 
)
Returns
array<Component>

Definition at line 68 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\getFilterComponent(), and ILIAS\Test\Participants\ParticipantTable\getTableComponent().

68  : array
69  {
70  $filter = $this->getFilterComponent($filter_url, $this->test_request->getRequest());
71  $table = $this->getTableComponent(
72  $this->test_request->getRequest(),
73  $this->ui_service->filter()->getData($filter)
74  );
75 
76  return [
77  $filter,
78  $table->withActions($this->table_actions->getEnabledActions(...$this->acquireParameters($url_builder)))
79  ];
80  }
getTableComponent(ServerRequestInterface $request, ?array $filter)
getFilterComponent(string $action, ServerRequestInterface $request)
+ Here is the call graph for this function:

◆ getFilterComponent()

ILIAS\Test\Participants\ParticipantTable::getFilterComponent ( string  $action,
ServerRequestInterface  $request 
)
private

Definition at line 247 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\getFilterFields().

Referenced by ILIAS\Test\Participants\ParticipantTable\getComponents().

248  {
249  $filter_inputs = [];
250  $is_input_initially_rendered = [];
251  $field_factory = $this->ui_factory->input()->field();
252 
253  foreach ($this->getFilterFields($field_factory) as $filter_id => $filter) {
254  [$filter_inputs[$filter_id], $is_input_initially_rendered[$filter_id]] = $filter;
255  }
256 
257  return $this->ui_service->filter()->standard(
258  'participant_filter',
259  $action,
260  $filter_inputs,
261  $is_input_initially_rendered,
262  true,
263  true
264  );
265  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFilterFields(FieldFactory $field_factory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilterFields()

ILIAS\Test\Participants\ParticipantTable::getFilterFields ( FieldFactory  $field_factory)
private
Parameters
FieldFactory$field_factory
Returns
array<string, FilterInput>

Definition at line 272 of file ParticipantTable.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\Test\Participants\ParticipantTable\getFilterComponent().

272  : array
273  {
274  $yes_no_all_options = [
275  'true' => $this->lng->txt('yes'),
276  'false' => $this->lng->txt('no')
277  ];
278 
279  $solution_options = [
280  'false' => $this->lng->txt('without_solution'),
281  'true' => $this->lng->txt('with_solution')
282  ];
283 
284  $status_of_attempt_options = [
285  StatusOfAttempt::NOT_YET_STARTED->value => $this->lng->txt(StatusOfAttempt::NOT_YET_STARTED->value),
286  StatusOfAttempt::RUNNING->value => $this->lng->txt(StatusOfAttempt::RUNNING->value),
287  StatusOfAttempt::FINISHED_BY_UNKNOWN->value => $this->lng->txt(StatusOfAttempt::FINISHED_BY_UNKNOWN->value),
288  StatusOfAttempt::FINISHED_BY_ADMINISTRATOR->value => $this->lng->txt(StatusOfAttempt::FINISHED_BY_ADMINISTRATOR->value),
289  StatusOfAttempt::FINISHED_BY_CRONJOB->value => $this->lng->txt(StatusOfAttempt::FINISHED_BY_CRONJOB->value),
290  StatusOfAttempt::FINISHED_BY_DURATION->value => $this->lng->txt(StatusOfAttempt::FINISHED_BY_DURATION->value),
291  StatusOfAttempt::FINISHED_BY_PARTICIPANT->value => $this->lng->txt(StatusOfAttempt::FINISHED_BY_PARTICIPANT->value),
292  ];
293 
294  $filters = [
295  'name' => [$field_factory->text($this->lng->txt('name')), true],
296  'login' => [$field_factory->text($this->lng->txt('login')), true],
297  'ip_range' => [$field_factory->text($this->lng->txt('client_ip_range')), true],
298  'solution' => [$field_factory->select($this->lng->txt('solutions'), $solution_options), true],
299  ];
300 
301  if ($this->test_object->getEnableProcessingTime()) {
302  $filters['extra_time'] = [$field_factory->select($this->lng->txt('extratime'), $yes_no_all_options), true];
303  }
304 
305  $filters['status_of_attempt'] = [
306  $field_factory->select($this->lng->txt('status_of_attempt'), $status_of_attempt_options),
307  true
308  ];
309 
310  $filters['test_passed'] = [
311  $field_factory->select($this->lng->txt('tst_passed'), $yes_no_all_options),
312  true
313  ];
314 
315  return $filters;
316  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostLoadFilters()

ILIAS\Test\Participants\ParticipantTable::getPostLoadFilters ( )
private
Returns
array<string, >

Definition at line 173 of file ParticipantTable.php.

References ILIAS\Test\Participants\Participant\getAttemptOverviewInformation(), ILIAS\Test\Participants\Participant\hasAnsweredQuestionsForScoredAttempt(), and null.

Referenced by ILIAS\Test\Participants\ParticipantTable\matchFilter().

173  : array
174  {
175  return [
176  'solution' => fn(string $value, Participant $record) =>
177  $value === 'true' ? $record->hasAnsweredQuestionsForScoredAttempt() : !$record->hasAnsweredQuestionsForScoredAttempt(),
178  'status_of_attempt' => fn(string $value, Participant $record) =>
179  ($value === StatusOfAttempt::NOT_YET_STARTED->value && $record->getAttemptOverviewInformation()?->getStatusOfAttempt() === null) ||
180  $value === $record->getAttemptOverviewInformation()?->getStatusOfAttempt()->value,
181  'test_passed' => fn(string $value, Participant $record) => $value === 'true'
182  ? $record->getAttemptOverviewInformation()?->hasPassingMark() === true
183  : $record->getAttemptOverviewInformation()?->hasPassingMark() !== true
184  ];
185  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostLoadOrderFields()

ILIAS\Test\Participants\ParticipantTable::getPostLoadOrderFields ( )
private
Returns
array<string, >

Definition at line 190 of file ParticipantTable.php.

References Vendor\Package\$a, Vendor\Package\$b, ILIAS\Test\Participants\Participant\getAttemptOverviewInformation(), ILIAS\Test\Participants\Participant\getFirstAccess(), ILIAS\Test\Participants\Participant\getLastAccess(), ILIAS\Test\Participants\Participant\getMatriculation(), ILIAS\Test\Participants\Participant\getRemainingDuration(), and ILIAS\Test\Participants\Participant\getTotalDuration().

Referenced by ILIAS\Test\Participants\ParticipantTable\sortRecords().

190  : array
191  {
192  $processing_time = $this->test_object->getProcessingTimeInSeconds();
193  $reset_time_on_new_attempt = $this->test_object->getResetProcessingTime();
194 
195  return [
196  'attempt_started_at' => static fn(Participant $a, Participant $b) => $a->getFirstAccess() <=> $b->getFirstAccess(),
197  'total_duration' => static fn(
198  Participant $a,
199  Participant $b
200  ) => $a->getTotalDuration($processing_time) <=> $b->getTotalDuration($processing_time),
201  'remaining_duration' => static fn(
202  Participant $a,
203  Participant $b
204  ) => $a->getRemainingDuration($processing_time, $reset_time_on_new_attempt)
205  <=> $b->getRemainingDuration($processing_time, $reset_time_on_new_attempt),
206  'last_access' => static fn(Participant $a, Participant $b) => $a->getLastAccess() <=> $b->getLastAccess(),
207  'status_of_attempt' => static fn(
208  Participant $a,
209  Participant $b
210  ) => $a->getAttemptOverviewInformation()?->getStatusOfAttempt()
211  <=> $b->getAttemptOverviewInformation()?->getStatusOfAttempt(),
212  'reached_points' => static fn(
213  Participant $a,
214  Participant $b
215  ) => $a->getAttemptOverviewInformation()?->getReachedPoints()
216  <=> $b->getAttemptOverviewInformation()?->getReachedPoints(),
217  'nr_of_answered_questions' => static fn(
218  Participant $a,
219  Participant $b
220  ) => $a->getAttemptOverviewInformation()?->getNrOfAnsweredQuestions()
221  <=> $b->getAttemptOverviewInformation()?->getNrOfAnsweredQuestions(),
222  'percent_of_available_points' => static fn(
223  Participant $a,
224  Participant $b
225  ) => $a->getAttemptOverviewInformation()?->getReachedPointsInPercent()
226  <=> $b->getAttemptOverviewInformation()?->getReachedPointsInPercent(),
227  'test_passed' => static fn(
228  Participant $a,
229  Participant $b
230  ) => $a->getAttemptOverviewInformation()?->hasPassingMark()
231  <=> $b->getAttemptOverviewInformation()?->hasPassingMark(),
232  'mark' => static fn(
233  Participant $a,
234  Participant $b
235  ) => $a->getAttemptOverviewInformation()?->getMark() <=> $b->getAttemptOverviewInformation()?->getMark(),
236  'matriculation' => static fn(
237  Participant $a,
238  Participant $b
239  ) => $a->getMatriculation() <=> $b->getMatriculation(),
240  'id_of_attempt' => static fn(
241  Participant $a,
242  Participant $b
243  ) => $a->getAttemptOverviewInformation()?->getExamId() <=> $b->getAttemptOverviewInformation()?->getExamId()
244  ];
245  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableComponent()

ILIAS\Test\Participants\ParticipantTable::getTableComponent ( ServerRequestInterface  $request,
?array  $filter 
)
private

Definition at line 318 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\getColumns(), and ILIAS\Repository\lng().

Referenced by ILIAS\Test\Participants\ParticipantTable\getComponents().

319  {
320  return $this->ui_factory
321  ->table()
322  ->data(
323  $this,
324  $this->lng->txt('list_of_participants'),
325  $this->getColumns(),
326  )
327  ->withId(self::ID)
328  ->withRequest($request)
329  ->withFilter($filter);
330  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTotalRowCount()

ILIAS\Test\Participants\ParticipantTable::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 82 of file ParticipantTable.php.

References ILIAS\UI\Implementation\Component\Table\$range, ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), ILIAS\UI\Component\Table\DataRetrieval\getRows(), ILIAS\Test\Participants\ParticipantTable\getViewControlledRecords(), ILIAS\Repository\lng(), null, and ILIAS\UI\examples\Deck\repository().

82  : ?int
83  {
84  return $this->repository->countParticipants($this->test_object->getTestId(), $filter_data);
85  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ getViewControlledRecords()

ILIAS\Test\Participants\ParticipantTable::getViewControlledRecords ( ?array  $filter_data,
Range  $range,
Order  $order 
)
private
Returns
iterable<Participant>

Definition at line 456 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\filterRecords(), ILIAS\Test\Participants\ParticipantTable\limitRecords(), and ILIAS\Test\Participants\ParticipantTable\sortRecords().

Referenced by ILIAS\Test\Participants\ParticipantTable\getTotalRowCount().

456  : iterable
457  {
458  return $this->limitRecords(
459  $this->sortRecords(
460  $this->filterRecords(
461  $this->results_data_factory->addAttemptOverviewInformationToParticipants(
462  $this->results_presentation_settings,
463  $this->test_object,
464  $this->loadRecords($filter_data, $order)
465  ),
466  $filter_data
467  ),
468  $order
469  ),
470  $range
471  );
472  }
limitRecords(array $records, Range $range)
sortRecords(iterable $records, Order $order)
filterRecords(iterable $records, ?array $filter_data)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ limitRecords()

ILIAS\Test\Participants\ParticipantTable::limitRecords ( array  $records,
Range  $range 
)
private

Definition at line 525 of file ParticipantTable.php.

References ILIAS\Data\Range\getLength(), and ILIAS\Data\Range\getStart().

Referenced by ILIAS\Test\Participants\ParticipantTable\getViewControlledRecords().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecords()

ILIAS\Test\Participants\ParticipantTable::loadRecords ( ?array  $filter,
Order  $order 
)
private

Definition at line 423 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\$records, ILIAS\Test\Participants\Participant\getUserId(), null, and ILIAS\UI\examples\Deck\repository().

423  : iterable
424  {
425  if ($this->records !== null) {
426  return $this->records;
427  }
428 
429  $records = iterator_to_array(
430  $this->repository->getParticipants(
431  $this->test_object->getTestId(),
432  $filter,
433  null,
434  $order
435  )
436  );
437 
438  $access_filter = $this->participant_access_filter->getManageParticipantsUserFilter($this->test_object->getRefId());
439  $filtered_user_ids = $access_filter(array_map(
440  fn(Participant $participant) => $participant->getUserId(),
441  $records
442  ));
443 
444  $this->records = array_filter(
445  $records,
446  fn(Participant $participant) => in_array($participant->getUserId(), $filtered_user_ids),
447  );
448 
449  return $this->records;
450  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ matchFilter()

ILIAS\Test\Participants\ParticipantTable::matchFilter ( Participant  $record,
?array  $filter 
)
private

Definition at line 483 of file ParticipantTable.php.

References ILIAS\Test\Participants\ParticipantTable\getPostLoadFilters(), and null.

Referenced by ILIAS\Test\Participants\ParticipantTable\filterRecords().

483  : bool
484  {
485  if ($filter === null) {
486  return true;
487  }
488 
489  $post_load_filters = $this->getPostLoadFilters();
490  $allow = true;
491 
492  foreach ($filter as $key => $value) {
493  if (!$value) {
494  continue;
495  }
496 
497  $post_load_filter = $post_load_filters[$key] ?? fn() => true;
498  $allow = $allow && $post_load_filter($value, $record);
499  }
500 
501  return $allow;
502  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sortRecords()

ILIAS\Test\Participants\ParticipantTable::sortRecords ( iterable  $records,
Order  $order 
)
private

Definition at line 504 of file ParticipantTable.php.

References Vendor\Package\$a, Vendor\Package\$b, ILIAS\Test\Participants\ParticipantTable\$records, ILIAS\Data\Order\get(), and ILIAS\Test\Participants\ParticipantTable\getPostLoadOrderFields().

Referenced by ILIAS\Test\Participants\ParticipantTable\getViewControlledRecords().

504  : array
505  {
506  $post_load_order_fields = $this->getPostLoadOrderFields();
507  $records = iterator_to_array($records);
508 
509  uasort($records, static function (Participant $a, Participant $b) use ($order, $post_load_order_fields) {
510  foreach ($order->get() as $subject => $direction) {
511  $post_load_order_field = $post_load_order_fields[$subject] ?? fn() => 0;
512  $index = $post_load_order_field($a, $b);
513 
514  if ($index !== 0) {
515  return $direction === 'DESC' ? $index * -1 : $index;
516  }
517  }
518 
519  return 0;
520  });
521 
522  return $records;
523  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $records

iterable ILIAS\Test\Participants\ParticipantTable::$records = null
private

◆ ID

const ILIAS\Test\Participants\ParticipantTable::ID = 'pt'
private

Definition at line 41 of file ParticipantTable.php.


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