Exemplo n.º 1
0
 /**
  * Edits a comment or response.
  * 
  * @return	array
  */
 public function edit()
 {
     $returnValues = array('action' => 'saved');
     if ($this->response === null) {
         $editor = new CommentEditor($this->comment);
         $editor->update(array('message' => $this->parameters['data']['message']));
         $comment = new Comment($this->comment->commentID);
         $returnValues['commentID'] = $this->comment->commentID;
         $returnValues['message'] = $comment->getFormattedMessage();
     } else {
         $editor = new CommentResponseEditor($this->response);
         $editor->update(array('message' => $this->parameters['data']['message']));
         $response = new CommentResponse($this->response->responseID);
         $returnValues['responseID'] = $this->response->responseID;
         $returnValues['message'] = $response->getFormattedMessage();
     }
     return $returnValues;
 }