Skip to content

Instantly share code, notes, and snippets.

@kolyadin
Created February 14, 2014 09:14
Show Gist options
  • Save kolyadin/8998094 to your computer and use it in GitHub Desktop.
Save kolyadin/8998094 to your computer and use it in GitHub Desktop.
public static function newMessageSave() {
$recipient = UserFactory::getUser(self::getSlim()->request()->post('recipient'));
$message = new Message();
$message->setSentTime(new \DateTime());
$message->setAuthor(UserFactory::getCurrentUser());
$message->setRecipient($recipient);
$message->setContent(self::getSlim()->request()->post('message'));
$message->setRead(0);
$message->setRemovedAuthor(0);
$message->setRemovedRecipient(0);
MessageFactory::save($message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment