ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ProcessingStatus.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\FileUpload\DTO;
20 
22 
36 final class ProcessingStatus
37 {
41  public const OK = 1;
45  public const REJECTED = 2;
49  public const PENDING = 3;
53  public const DENIED = 4;
54 
55  private int $code;
56  private string $message;
57 
69  public function __construct(int $code, string $reason)
70  {
71  if (!in_array($code, [self::OK, self::REJECTED, self::DENIED, self::PENDING], true)) {
72  throw new \InvalidArgumentException(
73  'Invalid upload status code received. The code must be OK or REJECTED.'
74  );
75  }
76 
77  $this->code = $code;
78  $this->message = $reason;
79  }
80 
81  public function getCode(): int
82  {
83  return $this->code;
84  }
85 
86  public function getMessage(): string
87  {
88  return $this->message;
89  }
90 }
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.
string $reason
Error message for last request processed.
Definition: System.php:102
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Metadata.php:3