本文整理汇总了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);
}
示例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;
}
示例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);
}