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, $contentType, $length, $sha2, LanguageMap $display, LanguageMap $description = null, IRL $fileUrl = null, $content = null) |
||
56 | |||
57 | public function getUsageType() |
||
61 | |||
62 | public function getContentType() |
||
66 | |||
67 | public function getLength() |
||
71 | |||
72 | public function getSha2() |
||
76 | |||
77 | public function getDisplay() |
||
81 | |||
82 | public function getDescription() |
||
86 | |||
87 | public function getFileUrl() |
||
91 | |||
92 | public function getContent() |
||
96 | |||
97 | public function equals(Attachment $attachment) |
||
137 | } |
||
138 |