ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ProcessingStatus.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\FileUpload\DTO;
20 
22 
36 final class ProcessingStatus
37 {
42  const OK = 1;
46  const REJECTED = 2;
50  const DENIED = 4;
54  private $code;
58  private $message;
59 
60 
73  public function __construct($code, $reason)
74  {
75  $this->intTypeCheck($code, 'code');
76  $this->stringTypeCheck($reason, 'reason');
77 
78  if ($code !== self::OK && $code !== self::REJECTED && $code !== self::DENIED) {
79  throw new \InvalidArgumentException('Invalid upload status code received. The code must be OK or REJECTED.');
80  }
81 
82  $this->code = $code;
83  $this->message = $reason;
84  }
85 
86 
91  public function getCode()
92  {
93  return $this->code;
94  }
95 
96 
101  public function getMessage()
102  {
103  return $this->message;
104  }
105 }
const REJECTED
Upload got rejected by a processor.
const DENIED
Upload got denied by a processor, the upload will be removed immediately.
__construct($code, $reason)
ProcessingStatus constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Metadata.php:3