19declare(strict_types=0);
49 protected InfoFactoryInterface $info_factory
56 $object_ids = $filter->getObjectIds();
59 $user_obj_id_mappings = [];
60 foreach ($user_ids as $usr_id) {
61 foreach ($object_ids as $obj_id) {
63 $lp_mode = $olp->getCurrentMode();
64 $user_obj_id_mappings[$usr_id][$lp_mode][] = $obj_id;
69 $user_obj_id_mappings,
76 foreach (
$data as $entry) {
77 $obj_id = (
int) $entry[self::KEY_OBJ_ID];
78 $usr_id = (
int) $entry[self::KEY_USR_ID];
79 $obj_title = (string) $entry[self::KEY_OBJ_TITLE];
80 $percentage = (
int) $entry[self::KEY_LP_PERCENTAGE];
82 $lp_status = (
int) $entry[self::KEY_LP_STATUS];
83 $obj_type = (string) $entry[self::KEY_OBJ_TYPE];
84 $lp_mode = (
int) $entry[self::KEY_LP_MODE];
85 $spent_seconds = (
int) $entry[self::KEY_LP_SPENT_SECONDS];
87 $visits = (
int) $entry[self::KEY_LP_VISITS];
88 $read_count = (
int) $entry[self::KEY_LP_READ_COUNT];
89 $lp_info = $this->info_factory->lp(
101 $object_info = $this->info_factory->objectData(
107 $lp_infos[] = $lp_info;
108 $object_infos[] = $object_info;
109 $combined_infos[] = $this->info_factory->combined(
115 return $this->info_factory->view(
116 $this->info_factory->iterator()->objectData(...$object_infos),
117 $this->info_factory->iterator()->lp(...$lp_infos),
118 $this->info_factory->iterator()->combined(...$combined_infos)
123 array $user_obj_id_mappings,
124 bool $only_data_of_objects_with_lp_enabled =
true
127 foreach ($user_obj_id_mappings as $usr_id => $mode_mapping) {
128 foreach ($mode_mapping as $lp_mode => $obj_ids) {
129 $obj_ids = array_flip($obj_ids);
159 if ($only_data_of_objects_with_lp_enabled) {
170 foreach ($new_data as $new) {
171 $new[self::KEY_LP_MODE] = $lp_mode;
172 $new[self::KEY_USR_ID] = $usr_id;
const KEY_OBJ_DESCRIPTION
const KEY_LP_SPENT_SECONDS
collectLPDataWithIlTryQuery(array $user_obj_id_mappings, bool $only_data_of_objects_with_lp_enabled=true)
isPercentageAvailable(int $lp_mode)
retrieveViewInfo(FilterInterface $filter)
__construct(protected ilDBInterface $db, protected InfoFactoryInterface $info_factory)
const KEY_LP_STATUS_CHANGED
@classDescription Date and time handling
const int LP_MODE_COLLECTION_MOBS
const int LP_MODE_OBJECTIVES
const int LP_MODE_DEACTIVATED
const int LP_MODE_COLLECTION_MANUAL
const int LP_MODE_UNDEFINED
const int LP_MODE_COLLECTION_TLT
Base class for object lp connectors.
static getInstance(int $obj_id)
Class ilObject Basic functions for all objects.
static _lookupDescription(int $obj_id)
static getSCOsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_sco_ids)
static getObjectivesStatusForUser(int $a_user_id, int $a_obj_id, array $a_objective_ids)
static getSubItemsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_item_ids)
Get subitems status.
static getObjectsStatusForUser(int $a_user_id, array $obj_refs)
collectOnlyDataOfObjectsWithLPEnabled()
if(!file_exists('../ilias.ini.php'))