1 <?php
2 /**
3 * ArangoDB PHP client: connection
4 *
5 * @package triagens\ArangoDb
6 * @author Jan Steemann
7 * @author Francis Chuang
8 * @copyright Copyright 2012, triagens GmbH, Cologne, Germany
9 */
10
11 namespace triagens\ArangoDb;
12
13 /**
14 * Class TraceRequest
15 *
16 * @author Francis Chuang
17 * @package triagens\ArangoDb
18 * @since 1.3
19 */
20 class TraceRequest
21 {
22 /**
23 * Stores each header as an array (key => value) element
24 *
25 * @var array
26 */
27 private $_headers = [];
28
29 /**
30 * Stores the http method
31 *
32 * @var string
33 */
34 private $_method;
35
36 /**
37 * Stores the request url
38 *
39 * @var string
40 */
41 private $_requestUrl;
42
43 /**
44 * Store the string of the body
45 *
46 * @var string
47 */
48 private $_body;
49
50 /**
51 * The http message type
52 *
53 * @var string
54 */
55 private $_type = 'request';
56
57 /**
58 * Set up the request trace
59 *
60 * @param array $headers - the array of http headers
61 * @param string $method - the request method
62 * @param string $requestUrl - the request url
63 * @param string $body - the string of http body
64 */
65 public function __construct($headers, $method, $requestUrl, $body)
66 {
67 $this->_headers = $headers;
68 $this->_method = $method;
69 $this->_requestUrl = $requestUrl;
70 $this->_body = $body;
71 }
72
73 /**
74 * Get an array of the request headers
75 *
76 * @return array
77 */
78 public function getHeaders()
79 {
80 return $this->_headers;
81 }
82
83 /**
84 * Get the request method
85 *
86 * @return string
87 */
88 public function getMethod()
89 {
90 return $this->_method;
91 }
92
93 /**
94 * Get the request url
95 *
96 * @return string
97 */
98 public function getRequestUrl()
99 {
100 return $this->_requestUrl;
101 }
102
103 /**
104 * Get the body of the request
105 *
106 * @return string
107 */
108 public function getBody()
109 {
110 return $this->_body;
111 }
112
113 /**
114 * Get the http message type
115 *
116 * @return string
117 */
118 public function getType()
119 {
120 return $this->_type;
121 }
122 }
123