Total Complexity | 8 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ApiKeysRepository |
||
8 | { |
||
9 | public function incrementHit($serverSecret) |
||
12 | } |
||
13 | |||
14 | public function where($where) |
||
17 | } |
||
18 | |||
19 | private static function table() |
||
20 | { |
||
21 | return DB::table('cms_apikey'); |
||
22 | } |
||
23 | |||
24 | public function getSecretKeys() |
||
25 | { |
||
26 | return $this->where(['status' => 'active'])->pluck('secretkey'); |
||
27 | } |
||
28 | |||
29 | public function get() |
||
30 | { |
||
31 | return $this->table()->get(); |
||
32 | } |
||
33 | |||
34 | public function deleteById($id) |
||
35 | { |
||
36 | return $this->where(['id' => $id])->delete(); |
||
37 | } |
||
38 | |||
39 | public function updateById($status, $id) |
||
40 | { |
||
41 | return $this->where(['id' => $id])->update(['status' => $status]); |
||
42 | } |
||
43 | |||
44 | public function insertGetId($token) |
||
51 | ]); |
||
52 | } |
||
53 | } |