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


PHP Message::all方法代码示例

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


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

示例1: messageList

 public function messageList()
 {
     if (Auth::user()->role == 1) {
         $messages = Message::all();
         return View::make('backend.user.messagelist')->with('data', $messages);
     } elseif (Auth::user()->role == 2) {
         $messages = Message::where('recipient_id', '=', Auth::user()->id)->orWhere('mass_message', '=', 1)->get();
         return View::make('backend.user.messagelist')->with('data', $messages);
     }
 }
开发者ID:fencer-md,项目名称:stoticlle,代码行数:10,代码来源:MessageController.php

示例2: createTopic

 /**
  * createTopics-funktio lähettää Topic-mallille kutsun luoda uusi keskustelu ja Message-mallille lisätä uusi viesti
  */
 public static function createTopic()
 {
     $params = $_POST;
     if ($params['title'] != null && $params['content'] != null && !ctype_space($params['title']) && !ctype_space($params['content'])) {
         $topic = Topic::createTopic($params['title'], $params['category']);
         $message = Message::createMessage($topic->id, $params['content']);
         $messages = Message::all($topic->id);
         View::make('keskustelu.html', array('topic' => $topic, 'messages' => $messages));
     }
     $categories = Category::all();
     View::make('luokeskustelu.html', array('categories' => $categories, 'error' => "Otsikko tai aloitusviestisi oli tyhjä"));
 }
开发者ID:hyttijan,项目名称:Tsoha-Bootstrap,代码行数:15,代码来源:topic_controller.php

示例3: fetchMessages

 /**
  * Returns all the messages of a user
  * @param int userid
  * @return JSON $messages (object)
  */
 public function fetchMessages()
 {
     $inputJson = Input::json();
     $input = (array) $inputJson;
     //We need to validate the input first
     $rules = array('userid' => ['required']);
     $errorMessages = array('userid.required' => 'userid can not be empty');
     $validator = Validator::make($input, $rules, $errorMessages);
     //Exit early if the validator fails
     if ($validator->fails()) {
         return Response::json(array('success' => false, 'errors' => $validator->getMessageBag()->toArray()), 400);
         // 400 being the HTTP code for an invalid request.
     }
     $messages = Message::all();
     return Response::json($messages);
 }
开发者ID:RHoKAustralia,项目名称:onaroll21_backend,代码行数:21,代码来源:APIController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $messages = Message::all();
     return $this->render('messages.index', compact('messages'));
 }
开发者ID:hrmshandy,项目名称:laravel_larasset_app,代码行数:10,代码来源:MessagesController.php

示例5: PDO

<?php

spl_autoload_register(function ($class) {
    require_once str_replace('\\', '/', $class) . '.php';
});
$file = __DIR__ . '/storage/database.sqlite';
$options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ];
$pdo = new PDO("sqlite:{$file}", null, null, $options);
$pdo->exec("\n    CREATE TABLE IF NOT EXISTS\n      messages (\n      id INTEGER PRIMARY KEY AUTOINCREMENT,\n      content TEXT,\n      published_at DATETIME )\n");
$pdo->exec("\n    CREATE TABLE IF NOT EXISTS\n      histories (\n      id INTEGER PRIMARY KEY AUTOINCREMENT,\n      published_at DATETIME )\n");
// observers
$db = new Observers\DB($pdo, 'histories');
$splFile = new \SplFileObject(__DIR__ . '/storage/data.txt', 'a+');
$file = new Observers\File($splFile);
// subjects
$message = new Message($pdo);
$message->attach($db);
$message->attach($file);
$message->create('Hello world');
var_dump($message->all());
$stmt = $pdo->query('select * from histories');
var_dump($stmt->fetchAll());
var_dump(file_get_contents(__DIR__ . '/storage/data.txt'));
开发者ID:Antoine07,项目名称:Base-Objet,代码行数:23,代码来源:test.php

示例6: getIndex

 public function getIndex()
 {
     return View::make('messages.index')->with('messages', Message::all());
 }
开发者ID:tuananhpham94,项目名称:iFixCenter,代码行数:4,代码来源:MessagesController.php

示例7: getMessages

 public function getMessages()
 {
     return Message::all(array('conditions' => array('conversation_id' => $this->id), 'order' => 'timestamp asc'));
 }
开发者ID:boulama,项目名称:DreamVids,代码行数:4,代码来源:conversation.php

示例8: get

Route::get('/associate/{id}', ['as' => 'associate', 'uses' => 'ApartmentController@associateApartment']);
Route::patch('/set-default/{id}', ['as' => 'set-default', 'uses' => 'ApartmentController@setDefaultApartment']);
Route::post('/apartment-userinfo', ['as' => 'post-apartment-userinfo', 'uses' => 'ApartmentController@storeApartmentUserInfo']);
Route::resource('members', 'AdduserController');
Route::resource('polls', 'PollingController');
Route::post('/voteup', ['as' => 'voteup', 'uses' => 'PollingController@voteUp']);
Route::post('/votedown', ['as' => 'votedown', 'uses' => 'PollingController@voteDown']);
Route::get('/accept/{id}', ['as' => 'accept', 'uses' => 'AdminController@acceptAddRequest']);
Route::get('/reject/{id}', ['as' => 'reject', 'uses' => 'AdminController@rejectAddRequest']);
Route::patch('/setflatfloor/{id}', ['as' => 'setflatfloor', 'uses' => 'AdminController@update']);
Route::resource('bank', 'BankController');
Route::get('/linkBank/{id}', ['as' => 'linkBank', 'uses' => 'BankController@linkBank']);
Route::get('/searchbank', ['as' => 'searchbank', 'uses' => 'BankController@searchbank']);
// API
get('api/messages', function () {
    return Message::all();
});
post('api/messages', function () {
    return Message::create(Request::all());
});
#Image Uploader
#Route::get('/complaint', ['as' => 'complaint', 'uses' => 'ImageController@getUpload']);
Route::resource('complaints', 'ComplaintController');
Route::post('complaint', ['as' => 'complaint-post', 'uses' => 'ImageController@postUpload']);
Route::post('complaint/delete', ['as' => 'complaint-remove', 'uses' => 'ImageController@deleteUpload']);
Route::resource('classifieds', 'ClassifiedController');
Route::get('/timeline', ['as' => 'timeline', 'uses' => 'ComplaintController@getTimeline']);
#External Routes
Route::resource('visitors', 'VisitorController');
#Accounting Controllers
Route::resource('crm', 'CrmController');
开发者ID:suchayj,项目名称:easymanage,代码行数:31,代码来源:routes.php

示例9: getModerer

 public function getModerer()
 {
     // Are we logged in?
     //
     if (Auth::check()) {
         return View::make('/moderer')->with('messages', Message::all());
     }
     return View::make('/');
 }
开发者ID:Edznux,项目名称:nuitinfo,代码行数:9,代码来源:AccountController.php


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