本文整理匯總了PHP中ilMail::deleteMails方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilMail::deleteMails方法的具體用法?PHP ilMail::deleteMails怎麽用?PHP ilMail::deleteMails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilMail
的用法示例。
在下文中一共展示了ilMail::deleteMails方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteFolder
/**
* add folder
* @param integer id of parent folder
* @access public
*/
function deleteFolder($a_folder_id)
{
global $ilDB;
$query = $ilDB->queryf('
SELECT title FROM mail_obj_data
WHERE obj_id = %s', array('integer'), array($a_folder_id));
$row = $ilDB->fetchAssoc($query);
if (array_key_exists($row['title'], $this->default_folder)) {
return false;
}
include_once "Services/Mail/classes/class.ilMail.php";
$umail = new ilMail($this->user_id);
// SAVE SUBTREE DATA
$subtree = $this->mtree->getSubtree($this->mtree->getNodeData($a_folder_id));
// DELETE ENTRY IN TREE
$this->mtree->deleteTree($this->mtree->getNodeData($a_folder_id));
// DELETE ENTRY IN mobj_data
foreach ($subtree as $node) {
// DELETE mail(s) of folder(s)
$mails = $umail->getMailsOfFolder($node["obj_id"]);
foreach ($mails as $mail) {
$mail_ids[] = $mail["mail_id"];
}
if (is_array($mail_ids)) {
$umail->deleteMails($mail_ids);
}
// DELETE mobj_data entries
$statement = $ilDB->manipulateF('
DELETE FROM ' . $this->table_mail_obj_data . '
WHERE obj_id = %s', array('integer'), array($node['obj_id']));
}
return true;
}