当前位置: 首页>>代码示例>>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;未经允许,请勿转载。