1 | <?php |
||
8 | class QueryNode implements QueryNodeInterface |
||
9 | { |
||
10 | /** @var AdapterInterface */ |
||
11 | private $adapter; |
||
12 | /** @var string */ |
||
13 | private $sql; |
||
14 | /** @var array */ |
||
15 | private $bind = []; |
||
16 | /** @var string[] */ |
||
17 | private $columns = []; |
||
18 | |||
19 | /** |
||
20 | * QueryNode constructor. |
||
21 | * |
||
22 | * @param AdapterInterface $adapter |
||
23 | * @param string $sql |
||
24 | * @param array $bind |
||
25 | */ |
||
26 | public function __construct(AdapterInterface $adapter, $sql, array $bind = []) |
||
32 | |||
33 | #region Properties |
||
34 | |||
35 | /** |
||
36 | * @return AdapterInterface |
||
37 | */ |
||
38 | public function getAdapter() |
||
42 | |||
43 | /** |
||
44 | * @param AdapterInterface $adapter |
||
45 | * |
||
46 | * @return static |
||
47 | */ |
||
48 | public function setAdapter(AdapterInterface $adapter) |
||
53 | |||
54 | /** |
||
55 | * @return mixed |
||
56 | */ |
||
57 | public function getSql() |
||
61 | |||
62 | /** |
||
63 | * @param mixed $sql |
||
64 | * |
||
65 | * @return static |
||
66 | */ |
||
67 | public function setSql($sql) |
||
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | public function getBind() |
||
80 | |||
81 | /** |
||
82 | * @param array $bind |
||
83 | * |
||
84 | * @return static |
||
85 | */ |
||
86 | public function setBind(array $bind) |
||
91 | |||
92 | /** |
||
93 | * @return string[] |
||
94 | */ |
||
95 | public function getColumns() |
||
99 | |||
100 | /** |
||
101 | * @param string[] $columns |
||
102 | * |
||
103 | * @return static |
||
104 | */ |
||
105 | public function setColumns(array $columns) |
||
110 | |||
111 | #endregion |
||
112 | |||
113 | #region Query |
||
114 | |||
115 | /** |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function query() |
||
122 | |||
123 | /** |
||
124 | * @return Traversable |
||
125 | */ |
||
126 | public function fetch() |
||
130 | |||
131 | /** |
||
132 | * @return array |
||
133 | */ |
||
134 | public function fetchAll() |
||
138 | |||
139 | /** |
||
140 | * @return array |
||
141 | */ |
||
142 | public function fetchRow() |
||
146 | |||
147 | /** |
||
148 | * @return mixed |
||
149 | */ |
||
150 | public function fetchOne() |
||
154 | |||
155 | #endregion |
||
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | public function __toString() |
||
164 | |||
165 | /** |
||
166 | * Return a clone of this object |
||
167 | * |
||
168 | * @return static |
||
169 | */ |
||
170 | public function getClone() |
||
174 | } |
||
175 |