2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 /***********************************************************************/
15 class ATutorMessagesService extends ATutorService implements MessagesService {
16 public function createMessage($userId, $appId, $message, $optionalMessageId, SecurityToken $token) {
18 $messages = ATutorDbFetcher::get()->createMessage($userId, $token->getAppId(), $message);
19 } catch (SocialSpiException $e) {
21 } catch (Exception $e) {
22 throw new SocialSpiException("Invalid create message request: " . $e->getMessage(), ResponseError::$INTERNAL_ERROR);