当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObject::_setDeletedDate方法代码示例

本文整理汇总了PHP中ilObject::_setDeletedDate方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_setDeletedDate方法的具体用法?PHP ilObject::_setDeletedDate怎么用?PHP ilObject::_setDeletedDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObject的用法示例。


在下文中一共展示了ilObject::_setDeletedDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 final function _setDeletedDate($a_ref_id)
 {
     return parent::_setDeletedDate($a_ref_id);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:4,代码来源:class.ilObject2.php

示例2: saveSubTree

 /**
  * save subtree: delete a subtree (defined by node_id) to a new tree
  * with $this->tree_id -node_id. This is neccessary for undelete functionality
  * @param	integer	node_id
  * @return	integer
  * @access	public
  */
 function saveSubTree($a_node_id, $a_set_deleted = false)
 {
     global $ilDB;
     if (!$a_node_id) {
         $message = sprintf('%s::saveSubTree(): No valid parameter given! $a_node_id: %s', get_class($this), $a_node_id);
         $this->log->write($message, $this->log->FATAL);
         $this->ilErr->raiseError($message, $this->ilErr->WARNING);
     }
     // LOCKED ###############################################
     if ($this->__isMainTree()) {
         $ilDB->lockTables(array(0 => array('name' => 'tree', 'type' => ilDB::LOCK_WRITE), 1 => array('name' => 'object_reference', 'type' => ilDB::LOCK_WRITE)));
         #ilDB::_lockTables(array('tree' => 'WRITE',
         #	'object_reference' => 'WRITE'));
     }
     // GET LEFT AND RIGHT VALUE
     $query = 'SELECT * FROM ' . $this->table_tree . ' ' . 'WHERE ' . $this->tree_pk . ' = %s ' . 'AND child = %s ';
     $res = $ilDB->queryF($query, array('integer', 'integer'), array($this->tree_id, $a_node_id));
     while ($row = $ilDB->fetchObject($res)) {
         $lft = $row->lft;
         $rgt = $row->rgt;
     }
     // GET ALL SUBNODES
     $query = 'SELECT child FROM ' . $this->table_tree . ' ' . 'WHERE ' . $this->tree_pk . ' = %s ' . 'AND lft BETWEEN %s AND %s ';
     $res = $ilDB->queryF($query, array('integer', 'integer', 'integer'), array($this->tree_id, $lft, $rgt));
     $subnodes = array();
     while ($row = $ilDB->fetchAssoc($res)) {
         $subnodes[] = $row['child'];
     }
     if (!count($subnodes)) {
         // possibly already deleted
         // Unlock locked tables before returning
         if ($this->__isMainTree()) {
             $ilDB->unlockTables();
         }
         return false;
     }
     // SAVE SUBTREE
     foreach ($subnodes as $child) {
         // set node as deleted
         if ($a_set_deleted) {
             // TODO: new method that expects an array of ids
             ilObject::_setDeletedDate($child);
         }
     }
     // Set the nodes deleted (negative tree id)
     $query = 'UPDATE ' . $this->table_tree . ' ' . 'SET tree = %s ' . 'WHERE ' . $this->tree_pk . ' = %s ' . 'AND lft BETWEEN %s AND %s ';
     $res = $ilDB->manipulateF($query, array('integer', 'integer', 'integer', 'integer'), array(-$a_node_id, $this->tree_id, $lft, $rgt));
     if ($this->__isMainTree()) {
         $ilDB->unlockTables();
     }
     // LOCKED ###############################################
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:60,代码来源:class.ilTree.php

示例3: testObjectReference

 /**
  * test object reference queries 
  */
 public function testObjectReference()
 {
     include_once './Services/Object/classes/class.ilObject.php';
     $ref_ids = ilObject::_getAllReferences(1);
     $bool = ilObject::_setDeletedDate(1);
     $bool = ilObject::_resetDeletedDate(1);
     $date = ilObject::_lookupDeletedDate(1);
     $this->assertEquals($date, null);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:12,代码来源:ilObjectTest.php


注:本文中的ilObject::_setDeletedDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。