| @@ 53-59 (lines=7) @@ | ||
| 50 | * |
|
| 51 | * @return JsonResponse |
|
| 52 | */ |
|
| 53 | protected function respondWithItem($item, $callback) |
|
| 54 | { |
|
| 55 | $resource = new Item($item, $callback); |
|
| 56 | $rootScope = $this->get('app.fractal')->createData($resource); |
|
| 57 | ||
| 58 | return $this->respondWithArray($rootScope->toArray()); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @param mixed $collection |
|
| @@ 67-73 (lines=7) @@ | ||
| 64 | * |
|
| 65 | * @return JsonResponse |
|
| 66 | */ |
|
| 67 | protected function respondWithCollection($collection, $callback) |
|
| 68 | { |
|
| 69 | $resource = new Collection($collection, $callback); |
|
| 70 | $rootScope = $this->get('app.fractal')->createData($resource); |
|
| 71 | ||
| 72 | return $this->respondWithArray($rootScope->toArray()); |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * @param string $message |
|