1 | <?php |
||
19 | final class Attachment |
||
20 | { |
||
21 | private $usageType; |
||
22 | private $contentType; |
||
23 | private $length; |
||
24 | private $sha2; |
||
25 | private $display; |
||
26 | private $description; |
||
27 | private $fileUrl; |
||
28 | private $content; |
||
29 | |||
30 | /** |
||
31 | * @param IRI $usageType The type of usage of this attachment |
||
32 | * @param string $contentType The content type of the attachment |
||
33 | * @param int $length The length of the attachment data in octets |
||
34 | * @param string $sha2 The SHA-2 hash of the attachment data |
||
35 | * @param LanguageMap $display Localized display name (title) |
||
36 | * @param LanguageMap|null $description Localized description |
||
37 | * @param IRL|null $fileUrl An IRL at which the attachment data can be retrieved |
||
38 | * @param string|null $content The raw attachment content, please note that the content is not validated against |
||
39 | * the given SHA-2 hash |
||
40 | */ |
||
41 | public function __construct(IRI $usageType, string $contentType, int $length, string $sha2, LanguageMap $display, LanguageMap $description = null, IRL $fileUrl = null, string $content = null) |
||
56 | |||
57 | public function getUsageType(): IRI |
||
61 | |||
62 | public function getContentType(): string |
||
66 | |||
67 | public function getLength(): int |
||
71 | |||
72 | public function getSha2(): string |
||
76 | |||
77 | public function getDisplay(): LanguageMap |
||
81 | |||
82 | public function getDescription(): ?LanguageMap |
||
86 | |||
87 | public function getFileUrl(): ?IRL |
||
91 | |||
92 | public function getContent(): ?string |
||
96 | |||
97 | public function equals(Attachment $attachment): bool |
||
137 | } |
||
138 |