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