1 | <?php |
||
23 | class NewThreadBuilder extends AbstractMessageBuilder |
||
24 | { |
||
25 | protected $builderModel; |
||
26 | protected $sender; |
||
27 | protected $recipients = []; |
||
28 | |||
29 | /** |
||
30 | * Builds a new thread object with one new message |
||
31 | * |
||
32 | * @param ThreadBuilderModel $builderModel |
||
33 | * |
||
34 | * @return ThreadInterface |
||
35 | */ |
||
36 | public function build(ThreadBuilderModel $builderModel) |
||
49 | |||
50 | /** |
||
51 | * We update the thread with the thread data from the builder |
||
52 | * |
||
53 | * @param ThreadInterface $thread |
||
54 | */ |
||
55 | protected function setThreadData(ThreadInterface $thread) |
||
59 | |||
60 | /** |
||
61 | * Creates new thread meta for a single participant |
||
62 | * |
||
63 | * @param ThreadInterface $thread The thread we are building |
||
64 | * @param ParticipantInterface $participant The participant whom we create thread meta for |
||
65 | * |
||
66 | * @return ThreadMetaInterface |
||
67 | */ |
||
68 | private function createThreadMetaForParticipant(ThreadInterface $thread, ParticipantInterface $participant) |
||
84 | |||
85 | /** |
||
86 | * Creates a new thread meta object from the config (user specified) thread meta class |
||
87 | * |
||
88 | * @return ThreadMetaInterface |
||
89 | */ |
||
90 | private function createThreadMeta() |
||
94 | |||
95 | /** |
||
96 | * Creates thread meta for a new thread. |
||
97 | * |
||
98 | * We need thread meta for each participant |
||
99 | * |
||
100 | * @param ThreadInterface $thread The thread we create thread meta for |
||
101 | */ |
||
102 | private function createThreadMetaForNewThread(ThreadInterface $thread) |
||
110 | |||
111 | /** |
||
112 | * Builds the thread meta for the sender |
||
113 | * |
||
114 | * @param ThreadInterface $thread |
||
115 | */ |
||
116 | private function buildThreadMetaForSender(ThreadInterface $thread) |
||
121 | |||
122 | /** |
||
123 | * Builds the thread meta for the recipient |
||
124 | * |
||
125 | * @param ThreadInterface $thread |
||
126 | * @param ParticipantInterface $recipient |
||
127 | */ |
||
128 | private function buildThreadMetaForRecipient(ThreadInterface $thread, ParticipantInterface $recipient) |
||
133 | |||
134 | /** |
||
135 | * Creates a new thread object from the config (user specified) thread class |
||
136 | * |
||
137 | * @return ThreadInterface |
||
138 | */ |
||
139 | private function createThread() |
||
143 | } |
||
144 |