當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。