本文整理汇总了PHP中ilLPStatusWrapper::_resetInfoCaches方法的典型用法代码示例。如果您正苦于以下问题:PHP ilLPStatusWrapper::_resetInfoCaches方法的具体用法?PHP ilLPStatusWrapper::_resetInfoCaches怎么用?PHP ilLPStatusWrapper::_resetInfoCaches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilLPStatusWrapper
的用法示例。
在下文中一共展示了ilLPStatusWrapper::_resetInfoCaches方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteProgress
/**
* Delete progress of users and objects
* Implemented for
*/
public function deleteProgress($sid, $ref_ids, $usr_ids, $type_filter, $progress_filter)
{
$this->initAuth($sid);
$this->initIlias();
// Check session
if (!$this->__checkSession($sid)) {
return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
}
// Check filter
if (array_diff((array) $type_filter, self::$DELETE_PROGRESS_FILTER_TYPES)) {
return $this->__raiseError('Invalid filter type given', 'Client');
}
include_once 'Services/User/classes/class.ilObjUser.php';
if (!in_array(self::USER_FILTER_ALL, $usr_ids) and !ilObjUser::userExists($usr_ids)) {
return $this->__raiseError('Invalid user ids given', 'Client');
}
$valid_refs = array();
foreach ((array) $ref_ids as $ref_id) {
$obj_id = ilObject::_lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
// All containers
if ($GLOBALS['objDefinition']->isContainer($type)) {
$all_sub_objs = array();
foreach ($type_filter as $type_filter_item) {
$sub_objs = $GLOBALS['tree']->getSubTree($GLOBALS['tree']->getNodeData($ref_id), false, $type_filter_item);
$all_sub_objs = array_merge($all_sub_objs, $sub_objs);
}
foreach ($all_sub_objs as $child_ref) {
$child_type = ilObject::_lookupType(ilObject::_lookupObjId($child_ref));
if (!$GLOBALS['ilAccess']->checkAccess('write', '', $child_ref)) {
return $this->__raiseError('Permission denied for : ' . $ref_id . ' -> type ' . $type, 'Client');
}
$valid_refs[] = $child_ref;
}
} elseif (in_array($type, $type_filter)) {
if (!$GLOBALS['ilAccess']->checkAccess('write', '', $ref_id)) {
return $this->__raiseError('Permission denied for : ' . $ref_id . ' -> type ' . $type, 'Client');
}
$valid_refs[] = $ref_id;
} else {
return $this->__raiseError('Invalid object type given for : ' . $ref_id . ' -> type ' . $type, 'Client');
}
}
// Delete tracking data
foreach ($valid_refs as $ref_id) {
include_once './Services/Object/classes/class.ilObjectFactory.php';
$obj = ilObjectFactory::getInstanceByRefId($ref_id, false);
if (!$obj instanceof ilObject) {
return $this->__raiseError('Invalid reference id given : ' . $ref_id . ' -> type ' . $type, 'Client');
}
// filter users
$valid_users = $this->applyProgressFilter($obj->getId(), (array) $usr_ids, (array) $progress_filter);
switch ($obj->getType()) {
case 'sahs':
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
$subtype = ilObjSAHSLearningModule::_lookupSubType($obj->getId());
switch ($subtype) {
case 'scorm':
$this->deleteScormTracking($obj->getId(), (array) $valid_users);
break;
case 'scorm2004':
$this->deleteScorm2004Tracking($obj->getId(), (array) $valid_users);
break;
}
break;
case 'tst':
foreach ((array) $valid_users as $usr_id) {
$obj->removeTestResultsForUser($usr_id);
}
break;
}
// Refresh status
include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
ilLPStatusWrapper::_resetInfoCaches($obj->getId());
ilLPStatusWrapper::_refreshStatus($obj->getId(), $valid_users);
}
return true;
}