Completed
Push — master ( b6a1f4...39b084 )
by Jared
02:16
created

OrderBy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A orderBy() 0 6 1
A getOrderBy() 0 4 1
1
<?php
2
3
namespace JAQB\Query\Traits;
4
5
trait OrderBy
6
{
7
    /**
8
     * @var OrderStatement
9
     */
10
    protected $orderBy;
11
12
    /**
13
     * Sets the order for the query.
14
     *
15
     * @param string|array $fields
16
     * @param string       $direction
17
     *
18
     * @return self
19
     */
20
    public function orderBy($fields, $direction = false)
21
    {
22
        $this->orderBy->addFields($fields, $direction);
23
24
        return $this;
25
    }
26
27
    /**
28
     * Gets the order by statement for the query.
29
     *
30
     * @return OrderByStatement
31
     */
32
    public function getOrderBy()
33
    {
34
        return $this->orderBy;
35
    }
36
}
37