1 | <?php |
||
23 | class Query implements QueryInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $compiledSQL; |
||
29 | |||
30 | /** |
||
31 | * @var ParameterCollectionInterface |
||
32 | */ |
||
33 | private $parameterCollection; |
||
34 | |||
35 | /** |
||
36 | * @var ConnectionInterface|null |
||
37 | */ |
||
38 | private $connection; |
||
39 | |||
40 | /** |
||
41 | * @param string $compiledSQL |
||
42 | * @param array $parameters |
||
43 | * @param ConnectionInterface|null $connection |
||
44 | */ |
||
45 | 3 | public function __construct($compiledSQL, array $parameters = [], ConnectionInterface $connection = null) |
|
46 | { |
||
47 | 3 | $this->compiledSQL = $compiledSQL; |
|
48 | 3 | $this->parameterCollection = new ParameterCollection($parameters); |
|
49 | 3 | $this->connection = $connection; |
|
50 | 3 | } |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getSQL() |
|
59 | |||
60 | /** |
||
61 | * @return ParameterCollectionInterface |
||
62 | */ |
||
63 | 2 | public function getParameters() |
|
67 | |||
68 | /** |
||
69 | * @return ConnectionInterface|null |
||
70 | */ |
||
71 | public function getConnection() |
||
75 | |||
76 | /** |
||
77 | * @param int|string $name |
||
78 | * @param mixed $value |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | 1 | public function setParameter($name, $value) |
|
88 | |||
89 | /** |
||
90 | * @return StatementInterface |
||
91 | */ |
||
92 | public function prepareStatement() |
||
102 | |||
103 | /** |
||
104 | * @return ResultStatementInterface |
||
105 | */ |
||
106 | public function getResult() |
||
113 | } |