ILIAS  release_8 Revision v8.24
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 public const OK = 1;
46 public const REJECTED = 2;
50 public const DENIED = 4;
51 private int $code;
52 private string $message;
53
54
67 public function __construct(int $code, string $reason)
68 {
69 $this->intTypeCheck($code, 'code');
70 $this->stringTypeCheck($reason, 'reason');
71
72 if ($code !== self::OK && $code !== self::REJECTED && $code !== self::DENIED) {
73 throw new \InvalidArgumentException('Invalid upload status code received. The code must be OK or REJECTED.');
74 }
75
76 $this->code = $code;
77 $this->message = $reason;
78 }
79
80
84 public function getCode(): int
85 {
86 return $this->code;
87 }
88
89
93 public function getMessage(): string
94 {
95 return $this->message;
96 }
97}
const REJECTED
Upload got rejected by a processor.
__construct(int $code, string $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
string $reason
Error message for last request processed.
Definition: System.php:102