1 | <?php |
||
15 | class Select extends Statement { |
||
16 | use TableNameBuilder; |
||
17 | use TableBuilder; |
||
18 | use JoinBuilder; |
||
19 | use WhereBuilder; |
||
20 | use HavingBuilder; |
||
21 | use GroupByBuilder; |
||
22 | use OrderByBuilder; |
||
23 | use LimitBuilder; |
||
24 | use OffsetBuilder; |
||
25 | use UnionBuilder; |
||
26 | |||
27 | /** @var string[] */ |
||
28 | private $fields = array(); |
||
29 | /** @var bool */ |
||
30 | private $calcFoundRows = false; |
||
31 | /** @var bool */ |
||
32 | private $forUpdate = false; |
||
33 | /** @var bool */ |
||
34 | private $distinct = false; |
||
35 | |||
36 | /** |
||
37 | * @param bool $distinct |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function distinct($distinct = true) { |
||
44 | |||
45 | /** |
||
46 | * @param string $expression |
||
47 | * @param string $alias |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function field($expression, $alias = null) { |
||
68 | |||
69 | /** |
||
70 | * @param array $fields |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function fields(array $fields) { |
||
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | */ |
||
83 | public function getFields() { |
||
86 | |||
87 | /** |
||
88 | * @param bool $enabled |
||
89 | * @return $this |
||
90 | */ |
||
91 | public function forUpdate($enabled = true) { |
||
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function getCalcFoundRows() { |
||
102 | |||
103 | /** |
||
104 | * @param bool $calcFoundRows |
||
105 | * @throws \Exception |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function setCalcFoundRows($calcFoundRows = true) { |
||
115 | |||
116 | /** |
||
117 | * @param string $alias |
||
118 | * @param string $tableName |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function from($alias, $tableName = null) { |
||
125 | |||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | public function __toString() { |
||
154 | |||
155 | /** |
||
156 | * @param string $query |
||
157 | * @return string |
||
158 | */ |
||
159 | private function buildFields($query) { |
||
174 | |||
175 | /** |
||
176 | * @param string $query |
||
177 | * @return string |
||
178 | */ |
||
179 | private function buildForUpdate($query) { |
||
185 | } |
||
186 |