1 | <?php |
||
32 | trait ColTrait |
||
33 | { |
||
34 | use AbstractTrait; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | * @access protected |
||
39 | */ |
||
40 | protected $is_distinct = false; |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | public function col($col = '', /*# string */ $alias = '') |
||
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | */ |
||
53 | public function distinct() |
||
58 | |||
59 | /** |
||
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | public function cnt(/*# string */ $col, /*# string */ $alias = '') |
||
63 | { |
||
64 | return $this->colTpl('COUNT(%s)', $col, $alias); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * {@inheritDoc} |
||
69 | */ |
||
70 | public function min(/*# string */ $col, /*# string */ $alias = '') |
||
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | public function max(/*# string */ $col, /*# string */ $alias = '') |
||
82 | |||
83 | /** |
||
84 | * {@inheritDoc} |
||
85 | */ |
||
86 | public function avg(/*# string */ $col, /*# string */ $alias = '') |
||
90 | |||
91 | /** |
||
92 | * {@inheritDoc} |
||
93 | */ |
||
94 | public function sum(/*# string */ $col, /*# string */ $alias = '') |
||
98 | |||
99 | /** |
||
100 | * {@inheritDoc} |
||
101 | */ |
||
102 | public function colTpl( |
||
109 | |||
110 | /** |
||
111 | * {@inheritDoc} |
||
112 | */ |
||
113 | public function colRaw(/*# string */ $rawString, array $params = []) |
||
118 | |||
119 | /** |
||
120 | * @param mixed $col column/field specification[s] |
||
121 | * @param string $alias column alias name |
||
122 | * @param bool $rawMode raw mode |
||
123 | */ |
||
124 | protected function realCol( |
||
144 | |||
145 | /** |
||
146 | * from multiple tables |
||
147 | * |
||
148 | * @param array $cols |
||
149 | * @param bool $rawMode |
||
150 | * @access protected |
||
151 | */ |
||
152 | protected function multipleCol(array $cols, /*# bool */ $rawMode) |
||
162 | |||
163 | /** |
||
164 | * Build fields |
||
165 | * |
||
166 | * @param strin $prefix prefix afront of the clause |
||
167 | * @param array $settings |
||
168 | * @return string |
||
169 | * @access protected |
||
170 | */ |
||
171 | protected function buildCol( |
||
183 | |||
184 | /** |
||
185 | * Build DISTINCT |
||
186 | * |
||
187 | * @param string $prefix |
||
188 | * @param array $settings |
||
189 | * @return string |
||
190 | * @access protected |
||
191 | */ |
||
192 | protected function buildDistinct( |
||
198 | } |
||
199 |