aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/JsonApi/Routes/Messages/InboxShow.php
blob: ec60b9fe9fd11f21a135d0643413b11e407142d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

namespace JsonApi\Routes\Messages;

use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;

/**
 * Liefert den Posteingang eines Nutzers zurück.
 */
class InboxShow extends BoxController
{
    protected $allowedFilteringParameters = ['unread'];

    public function __invoke(Request $request, Response $response, $args)
    {
        $filtering = $this->getQueryParameters()->getFilteringParameters();
        $onlyUnread = !empty($filtering['unread']);

        return $this->getBoxResponse($request, $args, 'rec', $onlyUnread);
    }
}