ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Exercise\Team\TeamLogRetrieval Class Reference
+ Inheritance diagram for ILIAS\Exercise\Team\TeamLogRetrieval:
+ Collaboration diagram for ILIAS\Exercise\Team\TeamLogRetrieval:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected \ilExAssignmentTeam $team)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter=[], array $parameters=[])
 
 isFieldNumeric (string $field)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter, array $parameters)
 
 isFieldNumeric (string $field)
 

Protected Member Functions

 collectData ()
 

Detailed Description

Definition at line 29 of file TeamLogRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\Team\TeamLogRetrieval::__construct ( protected InternalDomainService  $domain,
protected \ilExAssignmentTeam  $team 
)

Definition at line 33 of file TeamLogRetrieval.php.

36 {
37 }

Member Function Documentation

◆ collectData()

ILIAS\Exercise\Team\TeamLogRetrieval::collectData ( )
protected

Definition at line 68 of file TeamLogRetrieval.php.

68 : array
69 {
70 $data = [];
71
72 foreach ($this->team->getLog() as $item) {
73 $message = match ((int) $item['action']) {
79 default => ''
80 };
81
82 $details = $this->domain->lng()->txt('exc_team_log_' . $message);
83 if ($item['details']) {
84 $details = sprintf($details, $item['details']);
85 }
86
87 $data[] = [
88 'id' => (int) $item['log_id'],
89 'tstamp' => (int) $item['tstamp'],
90 'user' => \ilObjUser::_lookupFullname((int) $item['user_id']),
91 'details' => $details
92 ];
93 }
94
95 return $data;
96 }
static _lookupFullname(int $a_user_id)
$data
Definition: storeScorm.php:45

References $data, $message, ilObjUser\_lookupFullname(), ILIAS\Repository\int(), ilExAssignmentTeam\TEAM_LOG_ADD_FILE, ilExAssignmentTeam\TEAM_LOG_ADD_MEMBER, ilExAssignmentTeam\TEAM_LOG_CREATE_TEAM, ilExAssignmentTeam\TEAM_LOG_REMOVE_FILE, and ilExAssignmentTeam\TEAM_LOG_REMOVE_MEMBER.

+ Here is the call graph for this function:

◆ count()

ILIAS\Exercise\Team\TeamLogRetrieval::count ( array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 56 of file TeamLogRetrieval.php.

59 : int {
60 return count($this->collectData());
61 }
count(array $filter=[], array $parameters=[])

◆ getData()

ILIAS\Exercise\Team\TeamLogRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 39 of file TeamLogRetrieval.php.

45 : \Generator {
46 $data = $this->collectData();
47 $order ??= new Order('tstamp', Order::DESC);
48 $data = $this->applyOrder($data, $order);
49 $data = $this->applyRange($data, $range);
50
51 foreach ($data as $row) {
52 yield $row;
53 }
54 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
const DESC
Definition: Order.php:31

◆ isFieldNumeric()

ILIAS\Exercise\Team\TeamLogRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 63 of file TeamLogRetrieval.php.

63 : bool
64 {
65 return in_array($field, ['id', 'tstamp'], true);
66 }

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