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


PHP Message::find方法代码示例

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


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

示例1: destroy

 public function destroy($id)
 {
     $message = Message::find($id);
     $this->deletePicture($message);
     $message->delete();
     return Redirect::route('admin');
 }
开发者ID:anewage,项目名称:CEIT-liveblog,代码行数:7,代码来源:AdminController.php

示例2: check_message_rights

 public static function check_message_rights($message_id)
 {
     $user = self::get_user_logged_in();
     $message = new Message(Message::find($message_id));
     $id = $message->user_id;
     if ($user->userrole != 'ADMIN' && $user->id != $id) {
         Redirect::to('/', array('message' => 'You have no authority to perform that action.'));
     }
 }
开发者ID:CarnivoreBarnacle,项目名称:Forum,代码行数:9,代码来源:base_controller.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $message = Message::find($id);
     $message->fill(Input::all());
     $message->save();
     $material = Material::find(Input::get('materialid'));
     $material->status = 'ok';
     $material->save();
     return Redirect::to('/beheer');
 }
开发者ID:jeroenjvdb,项目名称:AVuitleendienst,代码行数:16,代码来源:messagecontroller.php

示例4: 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

示例5: message

 /**
  * gets message regardless of the error state of this ValueTO.
  * use this message ONLY WHEN valueTO is error.
  *
  * @return string|array
  */
 public function message()
 {
     if (!$this->message) {
         $type = $this->getType();
         $method = $this->getErrorMethod();
         $parameter = $this->getParameter();
         $this->message = $this->messenger->find($type, $method, $parameter);
     }
     return $this->message;
 }
开发者ID:wscore,项目名称:validation,代码行数:16,代码来源:ValueTO.php

示例6: actionEdit

 public function actionEdit()
 {
     $languages = Message::getLanguages();
     $model = new Message();
     $model->language = $_GET['language'];
     $model->file = $_GET['file'];
     $model->messageId = $_GET['message-id'];
     $model->message = Message::find($_GET['language'], $_GET['file'], $_GET['message-id']);
     $files = Message::getFiles($_GET['language']);
     $this->render('edit', array('languages' => $languages, 'files' => $files, 'language' => $model->language, 'file' => $model->file, 'message' => $model->message, 'messageId' => $model->messageId));
 }
开发者ID:ho96,项目名称:yii-admin,代码行数:11,代码来源:MessageController.php

示例7: messageformAction

 public function messageformAction($id = NULL, $nom, $nomfrm, $idFil)
 {
     $p = $this->getInstance($id);
     $user = User::findFirst();
     $message = Message::find("idProjet=" . $p->getId() . " AND idFil is NULL");
     foreach ($message as $msg) {
         $reponse = Message::find("idFil=" . $msg->getId());
     }
     $this->view->setVars(array("message" => $message, "reponse" => $reponse, "projet" => $p, "user" => $user, "nom" => $nom, "idFil" => $idFil, "nomfrm" => $nomfrm));
     $this->jquery->postFormOnClick(".validate", "Messages/repondre", "frmAjoutMessage", "#divMessages");
     $this->jquery->compile($this->view);
 }
开发者ID:nicolasBREYNAERT,项目名称:increase,代码行数:12,代码来源:ProjectsController.php

示例8: getMessages

 /**
  * retrieve the messages for this user and this page
  *
  * Does a query for the right messages
  *
  * @return Message data object with stream for messages
  *
  * @see MailboxAction::getMessages()
  */
 function getMessages()
 {
     $message = new Message();
     $message->from_profile = $this->user->id;
     $message->orderBy('created DESC, id DESC');
     $message->limit(($this->page - 1) * MESSAGES_PER_PAGE, MESSAGES_PER_PAGE + 1);
     if ($message->find()) {
         return $message;
     } else {
         return null;
     }
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:21,代码来源:outbox.php

示例9: deleteMessage

 public function deleteMessage($message_id)
 {
     try {
         $message = Message::find($message_id);
         if ($message) {
             $message->delete();
             MessageState::where('message_id', '=', $message_id)->delete();
         }
         return true;
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:Hounge,项目名称:Android_Push_Server,代码行数:13,代码来源:Notification.php

示例10: testHABTMRelation

 public function testHABTMRelation()
 {
     $this->assertCount(2, User::first()->messages()->get());
     User::first()->messages()->insert([['title' => 'sdf'], ['title' => '123123']]);
     $this->assertCount(4, User::first()->messages()->get());
     $this->assertCount(1, User::first()->messages()->get(['title'], ['sdf']));
     $ids = User::last()->messages()->insert([['title' => 'new title']]);
     $this->assertSame(4, User::first()->messages()->count());
     $this->assertSame(1, User::last()->messages()->count());
     $this->assertTrue(User::last()->messages()->has($ids[0]));
     $this->assertTrue(User::last()->messages()->delete($ids[0]));
     $this->assertFalse(User::last()->messages()->has($ids[0]));
     $this->assertFalse(User::last()->messages()->has(Message::find($ids[0])));
     // @todo test sync method
 }
开发者ID:gigorok,项目名称:php-orm,代码行数:15,代码来源:ModelTest.php

示例11: loadMessagesAction

 public function loadMessagesAction($idProjet, $idFil = NULL)
 {
     $sql = "idProjet=" . $idProjet;
     if ($idFil == null) {
         $sql .= " AND idFil IS NULL";
     } else {
         $sql .= " AND idFil=" . $idFil;
     }
     $messages = Message::find($sql);
     foreach ($messages as $msg) {
         $reponses[$msg->getId()] = $responses = count(Message::find("idFil=" . $msg->getId()));
     }
     $this->view->setVars(array("messages" => $messages, "responses" => $responses));
     $this->view->pick("messages/main");
 }
开发者ID:aleboisselier,项目名称:Increase,代码行数:15,代码来源:MessagesController.php

示例12: loadMessagesAction

 public function loadMessagesAction($idProjet, $idFil = NULL)
 {
     $sql = "idProjet=" . $idProjet;
     if ($idFil == null) {
         $sql .= " AND idFil IS NULL";
     } else {
         $sql .= " AND idFil=" . $idFil;
     }
     $messages = Message::find($sql);
     $result = array();
     foreach ($messages as $message) {
         $responses = count(Message::find("idFil=" . $message->getId()));
         array_push($result, array("id" => $message->getId(), "objet" => $message->getObjet(), "content" => $message->getContent(), "author" => $message->getUser()->__toString(), "responses" => $responses, "date" => $message->getSince()));
     }
     print_r(json_encode($result));
     $this->view->disable();
 }
开发者ID:aleboisselier,项目名称:Increase,代码行数:17,代码来源:JsonController.php

示例13: projectAction

 public function projectAction($id = NULL)
 {
     $p = Projet::findFirst("id=" . $id);
     $user = User::findFirst("id=" . $p->getId());
     //image a mettre
     if ($p->getImage() == NULL) {
         $source = "../../public/img/increase.png";
     } else {
         $source = $p->getImage();
     }
     $message = Message::find("idProjet=" . $p->getId() . " AND idFil is NULL");
     $nbMsg = 0;
     foreach ($message as $msg) {
         $nbMsg = $nbMsg + 1;
     }
     $this->view->setVars(array("project" => $p, "user" => $user, "source" => $source, "nbMsg" => $nbMsg));
     $this->jquery->get("Projects/equipe/" . $p->getId(), "#detailProject");
     $this->jquery->click(".btnMessages", "\$('#divMessages').slideToggle('slow');");
     $this->jquery->get("Projects/messages/" . $p->getId(), "#divMessages");
     $this->jquery->compile($this->view);
 }
开发者ID:nicolasBREYNAERT,项目名称:increase,代码行数:21,代码来源:UsersController.php

示例14: actionView

 public function actionView($mid = null)
 {
     if (defined('DISABLE_MESSAGING') && DISABLE_MESSAGING) {
         throw new Lvc_Exception('Messaging disabled');
     }
     $active_user = User::require_active_user();
     $this->setLayoutVar('active_user', $active_user);
     $this->setLayoutVar('pageHead', 'Message');
     $this->setLayoutVar('pageTitle', 'Message');
     if (is_null($mid)) {
         throw new Lvc_Exception('Null message id on view action');
     }
     if ($message = Message::find(array('mid' => $mid, 'user' => $active_user))) {
         if ($message->to_user->uid = $active_user->uid) {
             $message->mark_read();
         }
         $this->setVar('message', $message);
     } else {
         throw new Lvc_Exception('Message Not Found: ' . $mid);
     }
 }
开发者ID:bencochran,项目名称:yeti,代码行数:21,代码来源:message.php

示例15: indexAction

 public function indexAction()
 {
     if ($this->request->isAjax()) {
         //               $name = $_POST['name'];
         //               $content = $_POST['content'];
         //               $name = $_REQUEST['name'];
         //               $content = $_REQUEST['content'];
         $data = $_REQUEST;
         //               $data = [
         //                   'name' => $name,
         //                   'content' => $content
         //               ];
         $result = json_decode((new \Message())->addList($data), true);
         print_r($result);
         die;
     }
     //            $list = (new \Message())->getList();
     //            $this->view->setVar('list',$list);
     $data = Message::find();
     $page = (new \Message())->paging($data);
     $this->view->setVar('page', $page);
 }
开发者ID:xw716825,项目名称:xw,代码行数:22,代码来源:TestController.php


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