@@ 217-230 (lines=14) @@ | ||
214 | /** |
|
215 | * @inheritDoc |
|
216 | */ |
|
217 | public function getMessages($userId = null) |
|
218 | { |
|
219 | $connection = $this->container->get('connection'); |
|
220 | $acl = $this->container->get('acl'); |
|
221 | ||
222 | if ($userId === null) { |
|
223 | $userId = $acl->getUserId(); |
|
224 | } |
|
225 | ||
226 | $messagesTableGateway = new DirectusMessagesTableGateway($connection, $acl); |
|
227 | $result = $messagesTableGateway->fetchMessagesInboxWithHeaders($userId); |
|
228 | ||
229 | return $this->createResponseFromData($result); |
|
230 | } |
|
231 | ||
232 | public function getMessage($id, $userId = null) |
|
233 | { |
|
@@ 232-245 (lines=14) @@ | ||
229 | return $this->createResponseFromData($result); |
|
230 | } |
|
231 | ||
232 | public function getMessage($id, $userId = null) |
|
233 | { |
|
234 | $connection = $this->container->get('connection'); |
|
235 | $acl = $this->container->get('acl'); |
|
236 | ||
237 | if ($userId === null) { |
|
238 | $userId = $acl->getUserId(); |
|
239 | } |
|
240 | ||
241 | $messagesTableGateway = new DirectusMessagesTableGateway($connection, $acl); |
|
242 | $message = $messagesTableGateway->fetchMessageWithRecipients($id, $userId); |
|
243 | ||
244 | return $this->createResponseFromData($message); |
|
245 | } |
|
246 | ||
247 | /** |
|
248 | * @inheritDoc |