Total Complexity | 7 |
Total Lines | 95 |
Duplicated Lines | 0 % |
Coverage | 81.82% |
Changes | 0 |
1 | <?php |
||
14 | class ReturnEntities implements MutatorInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var callable|null |
||
18 | */ |
||
19 | protected $callback = null; |
||
20 | |||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | protected $fields = array('*'); |
||
25 | |||
26 | /** |
||
27 | * @var integer |
||
28 | */ |
||
29 | protected $offset = 0; |
||
30 | |||
31 | /** |
||
32 | * @var integer |
||
33 | */ |
||
34 | protected $limit = 10; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $table = ''; |
||
40 | |||
41 | /** |
||
42 | * Initializes the mutator instance. |
||
43 | * |
||
44 | * @param integer|null $limit |
||
45 | * @param integer $offset |
||
46 | */ |
||
47 | 21 | public function __construct($limit = 10, $offset = 0) |
|
52 | 21 | } |
|
53 | |||
54 | /** |
||
55 | * Sets a where callback to the query instance. |
||
56 | * |
||
57 | * @param callable $callback |
||
58 | * @return self |
||
59 | */ |
||
60 | 3 | public function callback($callback) |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * Returns the limit per result. |
||
69 | * |
||
70 | * @return integer |
||
71 | */ |
||
72 | public function limit() |
||
73 | { |
||
74 | return $this->limit; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Returns the offset of the current result. |
||
79 | * |
||
80 | * @return integer |
||
81 | */ |
||
82 | public function offset() |
||
83 | { |
||
84 | return $this->offset; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Mutates the specified query instance. |
||
89 | * |
||
90 | * @param \Rougin\Windstorm\QueryInterface $query |
||
91 | */ |
||
92 | 21 | public function set(QueryInterface $query) |
|
109 | } |
||
110 | } |
||
111 |