aboutsummaryrefslogtreecommitdiff
path: root/private/Model/Query.php
blob: df05b24ae799b42226a5e3861dd7020efc1440c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php

declare(strict_types=1);

namespace AugustOffensive\Model;

/**
 * Query object for storing relevant query information.
 */
class Query 
{
    /** @var array $path array of request structure. */
    private $path;

    /** @var string $request type of request made to the server. */
    private $request;

    /** @var array $content structure of information sent to the server. */
    private $content;

    /**
     * Store query information.
     *
     * @param array $path The array that holds the original request structure.
     * @param string $request The request method made to the server.
     * @param array $content The content object sent by the request.
     * 
     * @return Query
     */
    public function __construct (
        array $path, 
        string $request, 
        array $content
    ) {
        $this->path = $path;
        $this->request = $request;
        $this->content = $content;

        return $this;
    }

    /**
     * Returns the request path made by the client.
     * 
     * @return array 
     */
    public function getPath (): array
    {
        return $this->path;
    }

    /**
     * Returns the request type made by the client.
     * 
     * @return string
     */
    public function get_request (): string
    {
        return $this->request;
    }

    /**
     * Returns the information that is built from outside the request path.
     *
     * @return array
     */
    public function getContent (): array
    {
        return $this->content;
    }
}