| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function forUser($userId) |
||
| 15 | { |
||
| 16 | $this->validateID($userId); |
||
| 17 | |||
| 18 | try |
||
| 19 | { |
||
| 20 | $connections = $this->model->where('user_id', '=', $userId)->orderBy('connect_time', 'DESC')->get(); |
||
| 21 | } |
||
| 22 | catch(\Exception $e) |
||
| 23 | { |
||
| 24 | throw new RepositoryException('Could not fetch connections for user #'.$userId, RepositoryException::DATABASE_ERROR); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $connections; |
||
| 28 | } |
||
| 29 | |||
| 30 | } |