| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class UserRepository |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Retrieve the table name. |
||
| 17 | * |
||
| 18 | * @return string |
||
| 19 | */ |
||
| 20 | public function table() |
||
| 21 | { |
||
| 22 | return Auth::getProvider() |
||
| 23 | ->createModel() |
||
| 24 | ->getTable(); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Create a new query. |
||
| 29 | * |
||
| 30 | * @return \Illuminate\Database\Query\Builder |
||
| 31 | */ |
||
| 32 | public function query() |
||
| 33 | { |
||
| 34 | return Auth::getProvider() |
||
| 35 | ->createModel() |
||
| 36 | ->newQuery(); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns all remote IDs from users table |
||
| 41 | * |
||
| 42 | * @return \Illuminate\Support\Collection |
||
| 43 | */ |
||
| 44 | public function findRemoteIds() |
||
| 45 | { |
||
| 46 | return \Illuminate\Support\Facades\DB::table($this->table())->pluck('remote_id', 'id'); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Returns users with given IDs |
||
| 51 | * |
||
| 52 | * @param array $ids List of entity IDs to be queried |
||
| 53 | * |
||
| 54 | * @return \Illuminate\Database\Eloquent\Collection|Model[] |
||
| 55 | */ |
||
| 56 | public function many(array $ids) |
||
| 61 | } |
||
| 62 | } |