ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ProcessingStatus.php
Go to the documentation of this file.
1 <?php
2 
3 namespace ILIAS\FileUpload\DTO;
4 
6 
20 final class ProcessingStatus
21 {
26  const OK = 1;
30  const REJECTED = 2;
34  private $code;
38  private $message;
39 
40 
53  public function __construct($code, $reason)
54  {
55  $this->intTypeCheck($code, 'code');
56  $this->stringTypeCheck($reason, 'reason');
57 
58  if ($code !== self::OK && $code !== self::REJECTED) {
59  throw new \InvalidArgumentException('Invalid upload status code received. The code must be OK or REJECTED.');
60  }
61 
62  $this->code = $code;
63  $this->message = $reason;
64  }
65 
66 
71  public function getCode()
72  {
73  return $this->code;
74  }
75 
76 
81  public function getMessage()
82  {
83  return $this->message;
84  }
85 }
const REJECTED
Upload got rejected by a processor.
__construct($code, $reason)
ProcessingStatus constructor.