public function handleErrorSend() { $this->message = new Message(); if ($this->getRequestParameter('parent_id') != null) { $parent = MessagePeer::retrieveByUUID($this->getRequestParameter('message')); $this->forward404Unless($parent); $message = $parent->generateReplyMessage(); $this->message = $message; $this->recipientUsername = $message->getSfGuardUserRelatedByRecipientId()->getProfile()->getFullName(); } $this->setTemplate('compose'); return sfView::SUCCESS; }
public static function retrieveThread($id) { $messages = array(); $message = MessagePeer::retrieveByPK($id); while ($message != null) { $messages[] = $message; $message = MessagePeer::retrieveByUUID($message->getParentId()); } return array_reverse($messages); }