Beispiel #1
0
 /**
  * update the comment's message
  *
  * @param $propertyValue
  * @return bool
  */
 public function updateComment($propertyValue)
 {
     try {
         $this->comment->setMessage($propertyValue);
         $this->commentsManager->save($this->comment);
         return true;
     } catch (\Exception $e) {
         $this->logger->logException($e, ['app' => 'dav/comments']);
         return false;
     }
 }
Beispiel #2
0
 /**
  * update the comment's message
  *
  * @param $propertyValue
  * @return bool
  * @throws BadRequest
  * @throws Forbidden
  */
 public function updateComment($propertyValue)
 {
     $this->checkWriteAccessOnComment();
     try {
         $this->comment->setMessage($propertyValue);
         $this->commentsManager->save($this->comment);
         return true;
     } catch (\Exception $e) {
         $this->logger->logException($e, ['app' => 'dav/comments']);
         if ($e instanceof MessageTooLongException) {
             $msg = 'Message exceeds allowed character limit of ';
             throw new BadRequest($msg . IComment::MAX_MESSAGE_LENGTH, 0, $e);
         }
         throw $e;
     }
 }