59 : ViewInterface {
62
63 $user_obj_id_mappings = [];
64 foreach ($user_ids as $usr_id) {
65 foreach ($object_ids as $obj_id) {
67 $lp_mode = $olp->getCurrentMode();
68 $user_obj_id_mappings[$usr_id][$lp_mode][] = $obj_id;
69 }
70 }
71
73 $user_obj_id_mappings,
75 );
76
77 $object_infos = [];
78 $lp_infos = [];
79 $combined_infos = [];
80 foreach (
$data as $entry) {
81 $obj_id = (
int) $entry[self::KEY_OBJ_ID];
82 $usr_id = (
int) $entry[self::KEY_USR_ID];
83 $obj_title = (string) $entry[self::KEY_OBJ_TITLE];
84 $percentage = (
int) $entry[self::KEY_LP_PERCENTAGE];
86 $lp_status = (
int) $entry[self::KEY_LP_STATUS];
87 $obj_type = (string) $entry[self::KEY_OBJ_TYPE];
88 $lp_mode = (
int) $entry[self::KEY_LP_MODE];
89 $spent_seconds = (
int) $entry[self::KEY_LP_SPENT_SECONDS];
91 $visits = (
int) $entry[self::KEY_LP_VISITS];
92 $read_count = (
int) $entry[self::KEY_LP_READ_COUNT];
93 $lp_info = $this->info_factory->lp(
94 $usr_id,
95 $obj_id,
96 $lp_status,
97 $percentage,
98 $lp_mode,
99 $spent_seconds,
100 $status_changed,
101 $visits,
102 $read_count,
104 );
105 $object_info = $this->info_factory->objectData(
106 $obj_id,
107 $obj_title,
108 $obj_description,
109 $obj_type,
110 );
111 $lp_infos[] = $lp_info;
112 $object_infos[] = $object_info;
113 $combined_infos[] = $this->info_factory->combined(
114 $lp_info,
115 $object_info
116 );
117 }
118
119 return $this->info_factory->view(
120 $this->info_factory->iterator()->objectData(...$object_infos),
121 $this->info_factory->iterator()->lp(...$lp_infos),
122 $this->info_factory->iterator()->combined(...$combined_infos)
123 );
124 }
collectLPDataWithIlTryQuery(array $user_obj_id_mappings, bool $only_data_of_objects_with_lp_enabled=true)
isPercentageAvailable(int $lp_mode)
@classDescription Date and time handling
static getInstance(int $obj_id)
static _lookupDescription(int $obj_id)
collectOnlyDataOfObjectsWithLPEnabled()