ILIAS  release_7 Revision v7.30-3-g800a261c036
ProcessingStatus.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\FileUpload\DTO;
20
21use ILIAS\FileUpload\ScalarTypeCheckAware;
22
37{
38 use ScalarTypeCheckAware;
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}
An exception for terminatinating execution or to throw for unit testing.
const REJECTED
Upload got rejected by a processor.
__construct($code, $reason)
ProcessingStatus constructor.
const DENIED
Upload got denied by a processor, the upload will be removed immediately.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Metadata.php:3