| 1 | <?php |
||
| 7 | class Attachment |
||
| 8 | { |
||
| 9 | public const TYPE_FILE = 'file'; |
||
| 10 | public const TYPE_IMAGE = 'image'; |
||
| 11 | public const TYPE_AUDIO = 'audio'; |
||
| 12 | public const TYPE_VIDEO = 'video'; |
||
| 13 | |||
| 14 | private $type; |
||
| 15 | private $path; |
||
| 16 | private $metadata; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Get type. |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | 12 | public function getType(): string |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Set type. |
||
| 30 | * |
||
| 31 | * @param string $type |
||
| 32 | * |
||
| 33 | * @return Attachment |
||
| 34 | */ |
||
| 35 | 12 | public function setType(string $type): Attachment |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Get path. |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 4 | public function getPath(): string |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Set path. |
||
| 54 | * |
||
| 55 | * @param string $path |
||
| 56 | * |
||
| 57 | * @return Attachment |
||
| 58 | */ |
||
| 59 | 4 | public function setPath(string $path): Attachment |
|
| 65 | |||
| 66 | /** |
||
| 67 | * Get metadata. |
||
| 68 | * |
||
| 69 | * @return array |
||
| 70 | */ |
||
| 71 | 4 | public function getMetadata(): array |
|
| 75 | |||
| 76 | /** |
||
| 77 | * Set metadata. |
||
| 78 | * |
||
| 79 | * @param array $metadata |
||
| 80 | * |
||
| 81 | * @return Attachment |
||
| 82 | */ |
||
| 83 | 4 | public function setMetadata(array $metadata): Attachment |
|
| 89 | |||
| 90 | /** |
||
| 91 | * Get all types. |
||
| 92 | * |
||
| 93 | * @return array |
||
| 94 | */ |
||
| 95 | 5 | public static function possibleTypes(): array |
|
| 104 | } |
||
| 105 |