19declare(strict_types=0);
53 protected InfoFactoryInterface $info_factory
60 $object_ids = $filter->getObjectIds();
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;
73 $user_obj_id_mappings,
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(
105 $object_info = $this->info_factory->objectData(
111 $lp_infos[] = $lp_info;
112 $object_infos[] = $object_info;
113 $combined_infos[] = $this->info_factory->combined(
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)
127 array $user_obj_id_mappings,
128 bool $only_data_of_objects_with_lp_enabled =
true
131 foreach ($user_obj_id_mappings as $usr_id => $mode_mapping) {
132 foreach ($mode_mapping as $lp_mode => $obj_ids) {
133 $obj_ids = array_flip($obj_ids);
163 if ($only_data_of_objects_with_lp_enabled) {
174 foreach ($new_data as $new) {
175 $new[self::KEY_LP_MODE] = $lp_mode;
176 $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 LP_MODE_COLLECTION_TLT
const LP_MODE_DEACTIVATED
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_COLLECTION_MOBS
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'))