Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | public function orderBy($expression, $direction = 'asc') { |
||
18 | if(strtolower($direction) != 'desc') { |
||
19 | $direction = 'ASC'; |
||
20 | } |
||
21 | if(is_array($expression)) { |
||
22 | if(!count($expression)) { |
||
23 | return $this; |
||
24 | } |
||
25 | $arguments = array( |
||
26 | $expression[0], |
||
27 | array_slice($expression, 1) |
||
28 | ); |
||
29 | $expression = call_user_func_array(array($this->db(), 'quoteExpression'), $arguments); |
||
30 | } |
||
31 | $this->orderBy[] = array($expression, $direction); |
||
32 | return $this; |
||
33 | } |
||
34 | |||
52 |