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


PHP Message::delete方法代码示例

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


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

示例1: delete

 public static function delete($id, $topic_id)
 {
     self::checkLoggedIn();
     self::verifyRightsforDeletingOrEditingMessage($id);
     Message::delete($id);
     Redirect::to('/topics/' . $topic_id);
 }
开发者ID:glvv,项目名称:Keskustelufoorumi,代码行数:7,代码来源:message_controller.php

示例2: delete

 public function delete()
 {
     if ($this->id) {
         parent::delete();
     } else {
         throw new TheliaAdminException("Message not found", TheliaAdminException::MESSAGE_NOT_FOUND);
     }
     redirige("message.php");
 }
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:9,代码来源:MessageAdmin.class.php

示例3: destroyMessage

 public static function destroyMessage($id)
 {
     $message = new Message(Message::find($id));
     $user_id = $message->user_id;
     $thread_id = $message->thread_id;
     $message->delete();
     //Updating participants list
     ForumUser::changePostAmount($user_id, $thread_id, -1);
     Redirect::to('/thread/' . $message->thread_id, array('message' => 'Message deleted.'));
 }
开发者ID:CarnivoreBarnacle,项目名称:Forum,代码行数:10,代码来源:message_controller.php

示例4: deleteAction

 /**
  * deleteAction removes a message
  */
 public function deleteAction()
 {
     $id = $this->_getParam("id");
     if (!empty($id)) {
         require_once APPLICATION_PATH . "/model/Message.php";
         $table = new Message();
         $table->delete($table->getAdapter()->quoteInto('id = ?', $id));
         $this->_helper->redirector('index', 'message', 'default', array('deleted' => true));
         return;
     }
     $this->_helper->redirector('index', 'message');
 }
开发者ID:Kjir,项目名称:carpond,代码行数:15,代码来源:MessageController.php

示例5: deleteMessage

 private function deleteMessage($message_id)
 {
     $message = new Message($message_id);
     if ($message->reported) {
         $this->setCarryMessage('Cannot delete a reported message');
         return;
     }
     if ($message->to_user_id != \Current_User::getId()) {
         $this->setCarryMessage('Could not delete message.');
         return;
     }
     $message->delete();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:Roommate_User.php

示例6: handleMessage

 /**
  * Handles the message.
  *
  * @param Message $message 
  * @param array $params
  * @param Discord $discord 
  * @param Config $config 
  * @return void 
  */
 public static function handleMessage($message, $params, $discord, $config)
 {
     $rmmessages = isset($params[1]) ? $params[1] : 15;
     $channel = $message->channel;
     $num = 0;
     $channel->message_count = $rmmessages + 1;
     foreach ($channel->messages as $key => $message) {
         try {
             $message->delete();
         } catch (PartRequestFailedException $e) {
             continue;
         }
         $num++;
     }
     $message->reply("Flushed {$num} messages.");
 }
开发者ID:comentarinformal,项目名称:DiscordPHPBot,代码行数:25,代码来源:Flush.php

示例7: delete

 /**
  * Function: delete
  * Deletes the given topic. Calls the "delete_topic" trigger and passes the <Topic> as an argument.
  *
  * Parameters:
  *     $id - The topic to delete.
  */
 static function delete($id)
 {
     $topic = new self($id);
     foreach ($topic->message as $message) {
         Message::delete($message->id);
     }
     parent::destroy(get_class(), $id);
     foreach ($topic->attachments as $attachment) {
         unlink(uploaded($attachment->path, false));
     }
     if (module_enabled("cacher")) {
         Modules::$instances["cacher"]->regenerate();
     }
 }
开发者ID:vito,项目名称:chyrp-site,代码行数:21,代码来源:Topic.php

示例8: Message

 function _deleteMessages()
 {
     $msg = new Message();
     $msg->from_profile = $this->id;
     $msg->delete();
     $msg = new Message();
     $msg->to_profile = $this->id;
     $msg->delete();
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:9,代码来源:Profile.php

示例9: deleteAction

 function deleteAction()
 {
     // disable rendering of the view and layout so that we can just echo the AJAX output
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     if ($this->_getParam("deletemultiple") == '1') {
         // debugMessage($this->_getAllParams());
         // user is deleting more than one message
         $idsarray = $this->_getParam("messagesfordelete");
         // remove all empty keys in the array of ids to be deleted
         foreach ($idsarray as $key => $value) {
             if (isEmptyString($value)) {
                 unset($idsarray[$key]);
             }
         }
         // debugMessage($idsarray);
         $message = new MessageRecipient();
         if ($message->deleteMultiple($idsarray)) {
             debugMessage("Message(s) were successfully deleted");
         } else {
             debugMessage("An error occured in deleting your message(s)");
         }
     } else {
         // user is deleting only one message from reply page
         // the messageid being deleted
         $msgid = $this->_getParam("idfordelete");
         // debugMessage($this->_getAllParams());
         // populate message to be deleted
         $message = new Message();
         $message->populate($msgid);
         if ($message->delete()) {
             debugMessage("Message was successfully deleted");
         } else {
             debugMessage("An error occured in deleting your message");
         }
     }
     return false;
 }
开发者ID:7thZoneTechnology,项目名称:hrms-1,代码行数:38,代码来源:NotificationsController.php

示例10: sprintf

         if ($action == "insert") {
             $newId = Message::insert($message);
         } else {
             if ($action == "update") {
                 Message::update($message);
                 $emailResult = false;
                 //发送结果
                 include "email.php";
                 //发送邮件
                 if ($emailResult === false) {
                     $result = "邮件回复失败,请重试";
                     Tool::logger(__METHOD__, __LINE__, sprintf("回复邮件[%s]失败,请重试", $message->email), _LOG_ERROR);
                 }
             } else {
                 if ($action == "delete") {
                     Message::delete($message);
                 }
             }
         }
     } catch (Exception $e) {
         $result = $e->getMessage();
         Tool::logger(__METHOD__, __LINE__, sprintf("数据保存失败: %s", $e->getMessage()), _LOG_ERROR);
     }
 } else {
     if ($module == "user") {
         //用户
         if ($action == "modifypwd") {
             $loginName = isset($_REQUEST["loginName"]) ? $_REQUEST["loginName"] : "";
             $password = isset($_REQUEST["password"]) ? $_REQUEST["password"] : "";
             $npassword = isset($_REQUEST["npassword"]) ? $_REQUEST["npassword"] : "";
             try {
开发者ID:BassYang1,项目名称:YueXinChina,代码行数:31,代码来源:update.php

示例11: _updateMessage

 protected function _updateMessage($messageContent)
 {
     if ($messageContent) {
         if (!Validate::isMessage($messageContent)) {
             $this->errors[] = Tools::displayError('Invalid message');
         } else {
             if ($oldMessage = Message::getMessageByCartId((int) $this->context->cart->id)) {
                 $message = new Message((int) $oldMessage['id_message']);
                 $message->message = $messageContent;
                 $message->update();
             } else {
                 $message = new Message();
                 $message->message = $messageContent;
                 $message->id_cart = (int) $this->context->cart->id;
                 $message->id_customer = (int) $this->context->cart->id_customer;
                 $message->add();
             }
         }
     } else {
         if ($oldMessage = Message::getMessageByCartId($this->context->cart->id)) {
             $message = new Message($oldMessage['id_message']);
             $message->delete();
         }
     }
     return true;
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:26,代码来源:ParentOrderController.php

示例12: onProfileDeleteRelated

 public function onProfileDeleteRelated(Profile $profile, &$related)
 {
     $msg = new Message();
     $msg->from_profile = $profile->id;
     $msg->delete();
     $msg = new Message();
     $msg->to_profile = $profile->id;
     $msg->delete();
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:10,代码来源:DirectMessagePlugin.php

示例13: Message

<?php

//Imports
require_once 'session.php';
require_once 'db/db_conn.php';
require_once 'db/UPDATE.php';
require_once 'classes/Message.php';
if (!isset($_POST['id']) || !is_numeric($_POST['id'])) {
    http_response_code(400);
    exit;
}
if (!isset($_POST['tofrom']) || count($_POST['tofrom']) !== 1) {
    http_response_code(400);
    exit;
}
$inboxSent = $_POST['tofrom'];
$con = connect_db();
$ADK_MESSAGE = new Message();
$ADK_MESSAGE->id = intval($_POST['id']);
$ADK_MESSAGE->delete($con, $inboxSent);
if ($_SESSION['ADK_USERGROUP_CDE'] === 'HIK') {
    require_once 'classes/Hiker.php';
    Hiker::updateLastActive($con, intval($_SESSION['ADK_USER_ID']));
}
$con->close();
http_response_code(200);
开发者ID:neilsimp1,项目名称:adk,代码行数:26,代码来源:messageDelete.php

示例14: deleteMessage

 /**
  * Delete a message
  * @param int $message the message ID
  * @return void
  */
 private function deleteMessage($message)
 {
     require_once FRAMEWORK_PATH . 'models/message.php';
     $message = new Message($this->registry, $message);
     if ($message->getRecipient() == $this->registry->getObject('authenticate')->getUser()->getUserID()) {
         if ($message->delete()) {
             $url = $this->registry->getObject('url')->buildURL(array(), 'messages', false);
             $this->registry->redirectUser($url, 'Message deleted', 'The message has been removed from your inbox');
         } else {
             $this->registry->errorPage('Sorry...', 'An error occured while trying to delete the message');
         }
     } else {
         $this->registry->errorPage('Access denied', 'Sorry, you are not allowed to delete that message');
     }
 }
开发者ID:simontakite,项目名称:cookbooks,代码行数:20,代码来源:controller.php

示例15: _updateMessage

 protected function _updateMessage($messageContent)
 {
     if ($messageContent) {
         if (!Validate::isMessage($messageContent)) {
             $this->errors[] = Tools::displayError('Invalid message');
         } elseif ($oldMessage = Message::getMessageByCartId((int) self::$cart->id)) {
             $message = new Message((int) $oldMessage['id_message']);
             $message->message = htmlentities($messageContent, ENT_COMPAT, 'UTF-8');
             $message->update();
         } else {
             $message = new Message();
             $message->message = htmlentities($messageContent, ENT_COMPAT, 'UTF-8');
             $message->id_cart = (int) self::$cart->id;
             $message->id_customer = (int) self::$cart->id_customer;
             $message->add();
         }
     } else {
         if ($oldMessage = Message::getMessageByCartId((int) self::$cart->id)) {
             $message = new Message((int) $oldMessage['id_message']);
             $message->delete();
         }
     }
     return true;
 }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:24,代码来源:ParentOrderController.php


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