Ejemplo n.º 1
0
 /**
  * Validates parameters to load comments.
  */
 public function validateLoadComments()
 {
     $this->readInteger('lastCommentTime', false, 'data');
     $this->readInteger('objectID', false, 'data');
     $objectType = $this->validateObjectType();
     $this->commentProcessor = $objectType->getProcessor();
     if (!$this->commentProcessor->isAccessible($this->parameters['data']['objectID'])) {
         throw new PermissionDeniedException();
     }
 }
 /**
  * Validates parameters to load responses for a given comment id.
  */
 public function validateLoadResponses()
 {
     $this->readInteger('commentID', false, 'data');
     $this->readInteger('lastResponseTime', false, 'data');
     $this->readBoolean('loadAllResponses', true, 'data');
     $this->comment = new Comment($this->parameters['data']['commentID']);
     if (!$this->comment->commentID) {
         throw new UserInputException('commentID');
     }
     $this->commentManager = ObjectTypeCache::getInstance()->getObjectType($this->comment->objectTypeID)->getProcessor();
     if (!$this->commentManager->isAccessible($this->comment->objectID)) {
         throw new PermissionDeniedException();
     }
 }