1 | <?php |
||
20 | class Query |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $sql; |
||
26 | |||
27 | /** |
||
28 | * @var ParameterCollectionInterface |
||
29 | */ |
||
30 | private $parameterCollection; |
||
31 | |||
32 | /** |
||
33 | * @var ConnectionInterface |
||
34 | */ |
||
35 | private $connection; |
||
36 | |||
37 | /** |
||
38 | * @param string $sql |
||
39 | * @param ParameterCollectionInterface $parameterCollection |
||
40 | * @param ConnectionInterface $connection |
||
41 | */ |
||
42 | 4 | public function __construct( |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getSQL() |
|
56 | { |
||
57 | 1 | return $this->sql; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return mixed |
||
62 | */ |
||
63 | 2 | public function fetchScalar() |
|
67 | |||
68 | /** |
||
69 | * @return array |
||
70 | */ |
||
71 | 1 | public function fetchRow() |
|
75 | |||
76 | /** |
||
77 | * @return array |
||
78 | */ |
||
79 | 1 | public function fetchAll() |
|
83 | |||
84 | /** |
||
85 | * @return int |
||
86 | */ |
||
87 | 1 | public function rowCount() |
|
91 | |||
92 | /** |
||
93 | * @return int |
||
94 | */ |
||
95 | 1 | public function execute() |
|
99 | |||
100 | /** |
||
101 | * @return ParameterCollectionInterface |
||
102 | */ |
||
103 | 2 | public function getParameterCollection() |
|
104 | { |
||
105 | 2 | return $this->parameterCollection; |
|
106 | } |
||
107 | |||
108 | /** |
||
109 | * @param int|string $name |
||
110 | * @param mixed $value |
||
111 | * |
||
112 | * @return $this |
||
113 | */ |
||
114 | 1 | public function setParameter($name, $value) |
|
115 | { |
||
116 | 1 | $this->getParameterCollection()->getParameter($name)->setValue($value); |
|
117 | |||
118 | 1 | return $this; |
|
119 | } |
||
120 | |||
121 | /** |
||
122 | * @return ConnectionInterface |
||
123 | */ |
||
124 | 1 | public function getConnection() |
|
128 | } |