@@ 95-96 (lines=2) @@ | ||
92 | protected function addColumn($expr1, $expr2 = null, $func = null){ |
|
93 | // @todo: quotes |
|
94 | switch(true){ |
|
95 | case $expr2 && $func: |
|
96 | $col = sprintf('%s(%s) AS %s', strtoupper($func), $this->quote($expr1), $this->quote($expr2)); break; |
|
97 | case $expr2 && !$func: |
|
98 | $col = sprintf('%s AS %s', $this->quote($expr1), $this->quote($expr2)); break; |
|
99 | case !$expr2 && $func: |
|
@@ 97-98 (lines=2) @@ | ||
94 | switch(true){ |
|
95 | case $expr2 && $func: |
|
96 | $col = sprintf('%s(%s) AS %s', strtoupper($func), $this->quote($expr1), $this->quote($expr2)); break; |
|
97 | case $expr2 && !$func: |
|
98 | $col = sprintf('%s AS %s', $this->quote($expr1), $this->quote($expr2)); break; |
|
99 | case !$expr2 && $func: |
|
100 | $col = sprintf('%s(%s)', strtoupper($func), $this->quote($expr1)); break; |
|
101 | case !$expr2 && !$func: |
|
@@ 99-100 (lines=2) @@ | ||
96 | $col = sprintf('%s(%s) AS %s', strtoupper($func), $this->quote($expr1), $this->quote($expr2)); break; |
|
97 | case $expr2 && !$func: |
|
98 | $col = sprintf('%s AS %s', $this->quote($expr1), $this->quote($expr2)); break; |
|
99 | case !$expr2 && $func: |
|
100 | $col = sprintf('%s(%s)', strtoupper($func), $this->quote($expr1)); break; |
|
101 | case !$expr2 && !$func: |
|
102 | default: |
|
103 | $col = $this->quote($expr1); |