remove old readme
[atutor.git] / docs / mods / _standard / social / lib / Shindig / ATutorMessagesService.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010                                             */
6 /* Inclusive Design Institute                                          */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14
15 class ATutorMessagesService extends ATutorService implements MessagesService {
16   public function createMessage($userId, $appId, $message, $optionalMessageId, SecurityToken $token) {
17         try {
18                 $messages = ATutorDbFetcher::get()->createMessage($userId, $token->getAppId(), $message);
19         } catch (SocialSpiException $e) {
20                 throw $e;
21     } catch (Exception $e) {
22                 throw new SocialSpiException("Invalid create message request: " . $e->getMessage(), ResponseError::$INTERNAL_ERROR);
23     }
24   }
25 }
26 ?>