1 | <?php |
||
9 | class Attachment |
||
10 | { |
||
11 | public const TYPE_FILE = 'file'; |
||
12 | public const TYPE_IMAGE = 'image'; |
||
13 | public const TYPE_AUDIO = 'audio'; |
||
14 | public const TYPE_VIDEO = 'video'; |
||
15 | |||
16 | private $type; |
||
17 | private $path; |
||
18 | private $parameters; |
||
19 | |||
20 | 13 | public function __construct(string $type, string $path, array $parameters = []) |
|
26 | |||
27 | 13 | public static function create(string $type, string $path, array $parameters = []) |
|
28 | { |
||
29 | 13 | return new static($type, $path, $parameters); |
|
30 | } |
||
31 | |||
32 | 12 | public function getType(): string |
|
36 | |||
37 | public function setType(string $type): Attachment |
||
43 | |||
44 | 4 | public function getPath(): string |
|
48 | |||
49 | public function setPath(string $path): Attachment |
||
55 | |||
56 | 4 | public function getParameters(): Collection |
|
60 | |||
61 | public function setParameters(array $parameters): Attachment |
||
67 | |||
68 | 5 | public static function possibleTypes(): array |
|
77 | } |
||
78 |