當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilTree::_removeEntry方法代碼示例

本文整理匯總了PHP中ilTree::_removeEntry方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTree::_removeEntry方法的具體用法?PHP ilTree::_removeEntry怎麽用?PHP ilTree::_removeEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilTree的用法示例。


在下文中一共展示了ilTree::_removeEntry方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: purgeObjects

 /**
  * removes objects from system
  * 
  * @access	private
  * @param	array	list of objects
  * @return	boolean
  */
 function purgeObjects($a_nodes)
 {
     global $ilias, $ilLog;
     // Get purge limits
     $count_limit = $ilias->account->getPref("systemcheck_count_limit");
     if (!is_numeric($count_limit) || $count_limit < 0) {
         $count_limit = count($a_nodes);
     }
     $timestamp_limit = time();
     $age_limit = $ilias->account->getPref("systemcheck_age_limit");
     if (is_numeric($age_limit) && $age_limit > 0) {
         $timestamp_limit -= $age_limit * 60 * 60 * 24;
     }
     $type_limit = $ilias->account->getPref("systemcheck_type_limit");
     if ($type_limit) {
         $type_limit = trim($type_limit);
         if (strlen($type_limit) == 0) {
             $type_limit = null;
         }
     }
     // handle wrong input
     if (!is_array($a_nodes)) {
         $this->throwError(INVALID_PARAM, WARNING, DEBUG);
         return false;
     }
     // start delete process
     $this->writeScanLogLine("action\tref_id\tobj_id\ttype\telapsed\ttitle");
     $count = 0;
     foreach ($a_nodes as $node) {
         if ($type_limit && $node['type'] != $type_limit) {
             $this->writeScanLogLine("skip\t" . $node['child'] . "\t\t" . $node['type'] . "\t\t" . $node['title']);
             continue;
         }
         $count++;
         if ($count > $count_limit) {
             $this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because count limit was reached: " . $count_limit);
             break;
         }
         if ($node["deleted_timestamp"] > $timestamp_limit) {
             $this->writeScanLogLine("Stopped purging after " . ($count - 1) . " objects, because timestamp limit was reached: " . date("c", $timestamp_limit));
             continue;
         }
         $ref_id = $node["child"] ? $node["child"] : $node["ref_id"];
         $node_obj =& $ilias->obj_factory->getInstanceByRefId($ref_id, false);
         if ($node_obj === false) {
             $this->invalid_objects[] = $node;
             continue;
         }
         $message = sprintf('%s::purgeObjects(): Removing object (id:%s ref:%s)', get_class($this), $ref_id, $node_obj->getId());
         $ilLog->write($message, $ilLog->WARNING);
         $startTime = microtime(true);
         $node_obj->delete();
         ilTree::_removeEntry($node["tree"], $ref_id);
         $endTime = microtime(true);
         $this->writeScanLogLine("purged\t" . $ref_id . "\t" . $node_obj->getId() . "\t" . $node['type'] . "\t" . round($endTime - $startTime, 1) . "\t" . $node['title']);
     }
     $this->findInvalidChilds();
     $this->removeInvalidChilds();
     return true;
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:67,代碼來源:class.ilValidator.php


注:本文中的ilTree::_removeEntry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。