| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class GetFileLinkFiles |
||
| 12 | { |
||
| 13 | // Execute will process an uploading file |
||
| 14 | 4 | public function execute($linkID, $collection = false) |
|
| 15 | { |
||
| 16 | 4 | $files = FileLinkFiles::where('link_id', $linkID) |
|
| 17 | 4 | ->orderBy('user_id', 'ASC') |
|
| 18 | 4 | ->orderBy('created_at', 'ASC') |
|
| 19 | 4 | ->with('Files') |
|
| 20 | 4 | ->with('User') |
|
| 21 | 4 | ->get(); |
|
| 22 | |||
| 23 | 4 | Log::debug('Retrieved files attached to File Link ID '.$linkID.'. Data Gathered - ', array($files)); |
|
| 24 | 4 | if($collection) |
|
| 25 | { |
||
| 26 | 2 | return new FileLinkFilesCollection($files); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $files; |
|
| 30 | } |
||
| 31 | |||
| 32 | // Only retrieve the files that the guest can download |
||
| 33 | 8 | public function getGuestFiles($linkID) |
|
| 45 | } |
||
| 46 | } |
||
| 47 |