1 | <?php |
||
24 | abstract class AbstractMessage |
||
25 | { |
||
26 | protected TargetInterface $target; |
||
|
|||
27 | |||
28 | protected OptionsInterface $options; |
||
29 | |||
30 | protected CommonPayloadInterface $payload; |
||
31 | |||
32 | /** |
||
33 | * @param TargetInterface $target |
||
34 | * |
||
35 | * @return $this |
||
36 | */ |
||
37 | public function setTarget(TargetInterface $target): self |
||
38 | { |
||
39 | $this->target = $target; |
||
40 | |||
41 | return $this; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return TargetInterface |
||
46 | */ |
||
47 | public function getTarget(): TargetInterface |
||
48 | { |
||
49 | return $this->target; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param OptionsInterface $options |
||
54 | * |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setOptions(OptionsInterface $options): self |
||
58 | { |
||
59 | $this->options = $options; |
||
60 | |||
61 | return $this; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return OptionsInterface |
||
66 | */ |
||
67 | public function getOptions(): OptionsInterface |
||
68 | { |
||
69 | return $this->options; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return CommonPayloadInterface |
||
74 | */ |
||
75 | abstract public function getPayload(); |
||
76 | } |
||
77 |