|
@@ 230-243 (lines=14) @@
|
| 227 |
|
/** |
| 228 |
|
* @inheritDoc |
| 229 |
|
*/ |
| 230 |
|
public function getMessages($userId = null) |
| 231 |
|
{ |
| 232 |
|
$connection = $this->container->get('connection'); |
| 233 |
|
$acl = $this->container->get('acl'); |
| 234 |
|
|
| 235 |
|
if ($userId === null) { |
| 236 |
|
$userId = $acl->getUserId(); |
| 237 |
|
} |
| 238 |
|
|
| 239 |
|
$messagesTableGateway = new DirectusMessagesTableGateway($connection, $acl); |
| 240 |
|
$result = $messagesTableGateway->fetchMessagesInboxWithHeaders($userId); |
| 241 |
|
|
| 242 |
|
return $this->createResponseFromData($result); |
| 243 |
|
} |
| 244 |
|
|
| 245 |
|
public function getMessage($id, $userId = null) |
| 246 |
|
{ |
|
@@ 245-258 (lines=14) @@
|
| 242 |
|
return $this->createResponseFromData($result); |
| 243 |
|
} |
| 244 |
|
|
| 245 |
|
public function getMessage($id, $userId = null) |
| 246 |
|
{ |
| 247 |
|
$connection = $this->container->get('connection'); |
| 248 |
|
$acl = $this->container->get('acl'); |
| 249 |
|
|
| 250 |
|
if ($userId === null) { |
| 251 |
|
$userId = $acl->getUserId(); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
$messagesTableGateway = new DirectusMessagesTableGateway($connection, $acl); |
| 255 |
|
$message = $messagesTableGateway->fetchMessageWithRecipients($id, $userId); |
| 256 |
|
|
| 257 |
|
return $this->createResponseFromData($message); |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
/** |
| 261 |
|
* @inheritDoc |