本文整理汇总了PHP中ilObject::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::delete方法的具体用法?PHP ilObject::delete怎么用?PHP ilObject::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* delete object and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
//put here your module specific stuff
// delete feed block
include_once "./Services/Block/classes/class.ilCustomBlock.php";
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($this->getId());
$costum_block->setContextObjType($this->getType());
$c_blocks = $costum_block->queryBlocksForContext();
include_once "./Services/Block/classes/class.ilExternalFeedBlock.php";
foreach ($c_blocks as $c_block) {
if ($c_block["type"] == "feed") {
$fb = new ilExternalFeedBlock($c_block["id"]);
$fb->delete();
include_once "./Services/Block/classes/class.ilBlockSetting.php";
ilBlockSetting::_deleteSettingsOfBlock($c_block["id"], "feed");
}
}
//ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
return true;
}
示例2: delete
/**
* delete role template and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// put here role template specific stuff
global $rbacadmin;
// delete rbac permissions
$rbacadmin->deleteTemplate($this->getId(), $_GET["ref_id"]);
// always call parent delete function at the end!!
return parent::delete() ? true : false;
}
示例3: delete
/**
* delete object and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
//put here your module specific stuff
return true;
}
示例4: delete
/**
* delete userfolder and all related data
* DISABLED
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// DISABLED
return false;
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// put here userfolder specific stuff
// always call parent delete function at the end!!
return true;
}
示例5: delete
/**
* delete rolefolder and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// put here rolefolder specific stuff
global $rbacreview;
$roles = $rbacreview->getRolesOfRoleFolder($this->getRefId());
// FIRST DELETE ALL LOCAL/BASE ROLES OF FOLDER
foreach ($roles as $role_id) {
$roleObj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
$roleObj->setParent($this->getRefId());
$roleObj->delete();
unset($roleObj);
}
// always call parent delete function at the end!!
return true;
}
示例6: delete
/**
* delete SCORM learning module and all related data
*
* this method has been tested on may 9th 2004
* meta data, scorm lm data, scorm tree, scorm objects (organization(s),
* manifest, resources and items), tracking data and data directory
* have been deleted correctly as desired
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
global $ilDB, $ilLog;
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// delete meta data of scorm content object
/*
$nested = new ilNestedSetXML();
$nested->init($this->getId(), $this->getType());
$nested->deleteAllDBData();
*/
$this->deleteMetaData();
// delete data directory
ilUtil::delDir($this->getDataDirectory());
// delete scorm learning module record
$ilDB->manipulateF('DELETE FROM sahs_lm WHERE id = %s', array('integer'), array($this->getId()));
$ilLog->write("SAHS Delete(SAHSLM), Subtype: " . $this->getSubType());
if ($this->getSubType() == "scorm") {
// remove all scorm objects and scorm tree
include_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php";
include_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php";
$sc_tree = new ilSCORMTree($this->getId());
$r_id = $sc_tree->readRootId();
if ($r_id > 0) {
$items = $sc_tree->getSubTree($sc_tree->getNodeData($r_id));
foreach ($items as $item) {
$sc_object =& ilSCORMObject::_getInstance($item["obj_id"], $this->getId());
if (is_object($sc_object)) {
$sc_object->delete();
}
}
$sc_tree->removeTree($sc_tree->getTreeId());
}
}
if ($this->getSubType() != "scorm") {
// delete aicc data
$res = $ilDB->queryF('
SELECT aicc_object.obj_id FROM aicc_object, aicc_units
WHERE aicc_object.obj_id = aicc_units.obj_id
AND aicc_object.slm_id = %s', array('integer'), array($this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$obj_id = $row['obj_id'];
$ilDB->manipulateF('
DELETE FROM aicc_units WHERE obj_id = %s', array('integer'), array($obj_id));
}
$res = $ilDB->queryF('
SELECT aicc_object.obj_id FROM aicc_object, aicc_course
WHERE aicc_object.obj_id = aicc_course.obj_id
AND aicc_object.slm_id = %s', array('integer'), array($this->getId()));
while ($row = $ilDB->fetchAssoc($res)) {
$obj_id = $row['obj_id'];
$ilDB->manipulateF('
DELETE FROM aicc_course WHERE obj_id = %s', array('integer'), array($obj_id));
}
$ilDB->manipulateF('
DELETE FROM aicc_object WHERE slm_id = %s', array('integer'), array($this->getId()));
}
$q_log = "DELETE FROM scorm_tracking WHERE obj_id = " . $ilDB->quote($this->getId());
$ilLog->write("SAHS Delete(SAHSLM): " . $q_log);
$ilDB->manipulateF('DELETE FROM scorm_tracking WHERE obj_id = %s', array('integer'), array($this->getId()));
$q_log = "DELETE FROM sahs_user WHERE obj_id = " . $ilDB->quote($this->getId());
$ilLog->write("SAHS Delete(SAHSLM): " . $q_log);
$ilDB->manipulateF('DELETE FROM sahs_user WHERE obj_id = %s', array('integer'), array($this->getId()));
// always call parent delete function at the end!!
return true;
}
示例7: delete
/**
* delete learning module and all related data
*
* this method has been tested on may 9th 2004
* meta data, content object data, data directory, bib items
* learning module tree and pages have been deleted correctly as desired
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
global $ilDB;
global $ilBench;
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// delete lm object data
include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
ilLMObject::_deleteAllObjectData($this);
// delete meta data of content object
$this->deleteMetaData();
// delete bibitem data
$nested = new ilNestedSetXML();
$nested->init($this->getId(), "bib");
$nested->deleteAllDBData();
// delete learning module tree
$this->lm_tree->removeTree($this->lm_tree->getTreeId());
// delete data directory
ilUtil::delDir($this->getDataDirectory());
// delete content object record
$q = "DELETE FROM content_object WHERE id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// delete lm menu entries
$q = "DELETE FROM lm_menu WHERE lm_id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// remove auto glossary entries
$ilDB->manipulate("DELETE FROM lm_glossaries WHERE " . " lm_id = " . $ilDB->quote($this->getId(), "integer"));
return true;
}
示例8: delete
/**
* delete course and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
global $ilDB;
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// put here course specific stuff
$ilDB->manipulate("DELETE FROM exc_data " . "WHERE obj_id = " . $ilDB->quote($this->getId(), "integer"));
//$this->ilias->db->query($query);
//$this->file_obj->delete();
//$this->members_obj->delete();
// remove all notifications
include_once "./Services/Notification/classes/class.ilNotification.php";
ilNotification::removeForObject(ilNotification::TYPE_EXERCISE_SUBMISSION, $this->getId());
return true;
}
示例9: delete
/**
* delete object and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
global $ilDB;
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// delete record of table il_wiki_data
$query = "DELETE FROM il_wiki_data" . " WHERE id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
// remove all notifications
include_once "./Services/Notification/classes/class.ilNotification.php";
ilNotification::removeForObject(ilNotification::TYPE_WIKI, $this->getId());
include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
ilWikiPage::deleteAllPagesOfWiki($this->getId());
return true;
}
示例10: delete
/**
* delete object and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
// always call parent delete function first!!
if (!parent::delete()) {
return false;
}
// delete meta data
$this->deleteMetaData();
//put here your module specific stuff
$this->deleteQuestionpool();
return true;
}
示例11: delete
/**
* delete style object
*/
function delete()
{
global $ilDB;
// delete object
parent::delete();
// check whether this style is global default
$def_style = $this->ilias->getSetting("default_content_style_id");
if ($def_style == $this->getId()) {
$this->ilias->deleteSetting("default_content_style_id");
}
// check whether this style is global fixed
$fixed_style = $this->ilias->getSetting("fixed_content_style_id");
if ($fixed_style == $this->getId()) {
$this->ilias->deleteSetting("fixed_content_style_id");
}
// delete style parameter
$q = "DELETE FROM style_parameter WHERE style_id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// delete style file
$css_file_name = ilUtil::getWebspaceDir() . "/css/style_" . $this->getId() . ".css";
if (is_file($css_file_name)) {
unlink($css_file_name);
}
// delete entries in learning modules
include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
ilObjContentObject::_deleteStyleAssignments($this->getId());
// delete style data record
$q = "DELETE FROM style_data WHERE id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
}
示例12: delete
/**
* delete object and all related data
*
* @access public
* @return boolean true if all object data were removed; false if only a references were removed
*/
function delete()
{
$remove = parent::delete();
// always call parent delete function first!!
if (!$remove) {
return false;
}
$this->deleteMetaData();
// Delete all survey questions, constraints and materials
foreach ($this->questions as $question_id) {
$this->removeQuestion($question_id);
}
$this->deleteSurveyRecord();
ilUtil::delDir($this->getImportDirectory());
return true;
}
示例13: delete
/**
* delete media object
*/
function delete()
{
if (!($this->getId() > 0)) {
return;
}
$usages = $this->getUsages();
if (count($usages) == 0) {
// remove directory
ilUtil::delDir(ilObjMediaObject::_getDirectory($this->getId()));
// remove thumbnail directory
ilUtil::delDir(ilObjMediaObject::_getThumbnailDirectory($this->getId()));
// delete meta data of mob
$this->deleteMetaData();
// delete media items
ilMediaItem::deleteAllItemsOfMob($this->getId());
// delete object
parent::delete();
}
}
示例14: delete
/**
* deletes a user
* @access public
* @param integer user_id
*/
function delete()
{
global $rbacadmin, $ilDB;
// deassign from ldap groups
include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php';
$mapping = ilLDAPRoleGroupMapping::_getInstance();
$mapping->deleteUser($this->getId());
// remove mailbox / update sent mails
include_once "Services/Mail/classes/class.ilMailbox.php";
$mailbox = new ilMailbox($this->getId());
$mailbox->delete();
$mailbox->updateMailsOfDeletedUser($this->getLogin());
// delete feed blocks on personal desktop
include_once "./Services/Block/classes/class.ilCustomBlock.php";
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($this->getId());
$costum_block->setContextObjType("user");
$c_blocks = $costum_block->queryBlocksForContext();
include_once "./Services/Feeds/classes/class.ilPDExternalFeedBlock.php";
foreach ($c_blocks as $c_block) {
if ($c_block["type"] == "pdfeed") {
$fb = new ilPDExternalFeedBlock($c_block["id"]);
$fb->delete();
}
}
// delete block settings
include_once "./Services/Block/classes/class.ilBlockSetting.php";
ilBlockSetting::_deleteSettingsOfUser($this->getId());
// delete user_account
$ilDB->manipulateF("DELETE FROM usr_data WHERE usr_id = %s", array("integer"), array($this->getId()));
// delete user_prefs
ilObjUser::_deleteAllPref($this->getId());
// delete user_session
include_once "./Services/Authentication/classes/class.ilSession.php";
ilSession::_destroyByUserId($this->getId());
// remove user from rbac
$rbacadmin->removeUser($this->getId());
// remove bookmarks
// TODO: move this to class.ilBookmarkFolder
$q = "DELETE FROM bookmark_tree WHERE tree = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
$q = "DELETE FROM bookmark_data WHERE user_id = " . $ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// DELETE FORUM ENTRIES (not complete in the moment)
include_once './Modules/Forum/classes/class.ilObjForum.php';
ilObjForum::_deleteUser($this->getId());
// Delete link check notify entries
include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
ilLinkCheckNotify::_deleteUser($this->getId());
// Delete crs entries
include_once './Modules/Course/classes/class.ilObjCourse.php';
ilObjCourse::_deleteUser($this->getId());
// Delete user tracking
include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
ilObjUserTracking::_deleteUser($this->getId());
include_once 'Modules/Session/classes/class.ilEventParticipants.php';
ilEventParticipants::_deleteByUser($this->getId());
// Delete Tracking data SCORM 2004 RTE
include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php';
ilSCORM13Package::_removeTrackingDataForUser($this->getId());
// Delete Tracking data SCORM 1.2 RTE
include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
ilObjSCORMLearningModule::_removeTrackingDataForUser($this->getId());
// remove all notifications
include_once "./Services/Notification/classes/class.ilNotification.php";
ilNotification::removeForUser($this->getId());
// remove portfolios
include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php";
ilObjPortfolio::deleteUserPortfolios($this->getId());
// remove workspace
include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
$tree = new ilWorkspaceTree($this->getId());
$tree->cascadingDelete();
// remove disk quota entries
include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
ilDiskQuotaHandler::deleteByOwner($this->getId());
// Delete user defined field entries
$this->deleteUserDefinedFieldEntries();
// Delete clipboard entries
$this->clipboardDeleteAll();
// Reset owner
$this->resetOwner();
// Trigger deleteUser Event
global $ilAppEventHandler;
$ilAppEventHandler->raise('Services/User', 'deleteUser', array('usr_id' => $this->getId()));
// delete object data
parent::delete();
return true;
}
示例15: delete
/**
* delete session and all related data
*
* @access public
* @return bool
*/
public function delete()
{
global $ilDB;
global $ilAppEventHandler;
if (!parent::delete()) {
return false;
}
$query = "DELETE FROM event " . "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
$res = $ilDB->manipulate($query);
include_once './Modules/Session/classes/class.ilSessionAppointment.php';
ilSessionAppointment::_deleteBySession($this->getId());
include_once './Modules/Session/classes/class.ilEventItems.php';
ilEventItems::_delete($this->getId());
include_once './Modules/Session/classes/class.ilEventParticipants.php';
ilEventParticipants::_deleteByEvent($this->getId());
foreach ($this->getFiles() as $file) {
$file->delete();
}
$ilAppEventHandler->raise('Modules/Session', 'delete', array('object' => $this, 'obj_id' => $this->getId(), 'appointments' => $this->prepareCalendarAppointments('delete')));
return true;
}