-
Notifications
You must be signed in to change notification settings - Fork 177
/
MooUploadResponse.php
104 lines (79 loc) · 1.9 KB
/
MooUploadResponse.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
declare(strict_types=1);
namespace Oneup\UploaderBundle\Uploader\Response;
class MooUploadResponse extends AbstractResponse
{
protected int|string|null $id;
protected ?string $name;
protected int $size;
protected string $uploadedName;
public function __construct(protected bool $finish = true, protected int $error = 0)
{
parent::__construct();
}
public function assemble(): array
{
$data = $this->data;
$data['id'] = $this->id;
$data['name'] = $this->name;
$data['size'] = $this->size;
$data['error'] = $this->error;
$data['finish'] = $this->finish;
$data['upload_name'] = $this->uploadedName;
return $data;
}
public function setId(int|string|null $id): self
{
$this->id = $id;
return $this;
}
public function getId(): int|string|null
{
return $this->id;
}
public function setName(string $name = null): self
{
$this->name = $name;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setSize(mixed $size): self
{
$this->size = (int) $size;
return $this;
}
public function getSize(): int
{
return $this->size;
}
public function setError(int $error): self
{
$this->error = $error;
return $this;
}
public function getError(): int
{
return $this->error;
}
public function setFinish(bool $finish): self
{
$this->finish = $finish;
return $this;
}
public function getFinish(): bool
{
return $this->finish;
}
public function setUploadedName(string $name): self
{
$this->uploadedName = $name;
return $this;
}
public function getUploadedName(): string
{
return $this->uploadedName;
}
}