Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 55.56% |
Changes | 0 |
1 | <?php |
||
15 | class Result implements ResultInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var \Illuminate\Support\Collection |
||
19 | */ |
||
20 | protected $result; |
||
21 | |||
22 | /** |
||
23 | * Returns a number of affected rows. |
||
24 | * |
||
25 | * @return integer |
||
26 | */ |
||
27 | public function affected() |
||
28 | { |
||
29 | return $this->result->count(); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Returns a result from a query instance. |
||
34 | * |
||
35 | * @param \Rougin\Windstorm\QueryInterface $query |
||
36 | * @return \Rougin\Windstorm\ResultInterface |
||
37 | */ |
||
38 | 3 | public function execute(QueryInterface $query) |
|
39 | { |
||
40 | 3 | $this->result = $query->instance()->get(); |
|
41 | |||
42 | 3 | return $this; |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * Returns the first row from result. |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | 3 | public function first() |
|
51 | { |
||
52 | 3 | return $this->result->first(); |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * Returns the first row from result. |
||
57 | * |
||
58 | * @return mixed |
||
59 | */ |
||
60 | public function items() |
||
63 | } |
||
64 | } |
||
65 |