Total Complexity | 6 |
Total Lines | 88 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class SqlQuery |
||
8 | { |
||
9 | use ReplacesBindings; |
||
10 | |||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | private $number; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $sql; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $bindings; |
||
25 | |||
26 | /** |
||
27 | * @var float |
||
28 | */ |
||
29 | private $time; |
||
30 | |||
31 | /** |
||
32 | * SqlQuery constructor. |
||
33 | * |
||
34 | * @param int $number |
||
35 | * @param string $sql |
||
36 | * @param array $bindings |
||
37 | * @param float $time |
||
38 | */ |
||
39 | public function __construct($number, $sql, array $bindings, $time) |
||
40 | { |
||
41 | $this->number = $number; |
||
42 | $this->sql = $sql; |
||
43 | $this->bindings = $bindings; |
||
44 | $this->time = $time; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Get number of query. |
||
49 | * |
||
50 | * @return int |
||
51 | */ |
||
52 | public function number() |
||
53 | { |
||
54 | return $this->number; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Get raw SQL (without bindings). |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function raw() |
||
63 | { |
||
64 | return $this->sql; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Get bindings. |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function bindings() |
||
73 | { |
||
74 | return $this->bindings; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Get time. |
||
79 | * |
||
80 | * @return float |
||
81 | */ |
||
82 | public function time() |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Get full query with values from bindings inserted. |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function get() |
||
97 |