| 1 | <?php |
||
| 13 | class LaravelRepresentationController extends GenericRepresentationController |
||
| 14 | { |
||
| 15 | |||
| 16 | protected $model = null; |
||
| 17 | |||
| 18 | 1 | public function __construct(Model $model) |
|
| 22 | |||
| 23 | 1 | public function setModel(Model $model) |
|
| 28 | |||
| 29 | 1 | public function getModel() |
|
| 33 | |||
| 34 | /** |
||
| 35 | * HTTP/1.1 200 OK |
||
| 36 | * { |
||
| 37 | * "href" : "https://api.mycompany.com/v1/users?offset=50&limit=50" |
||
| 38 | * "offset": 50, |
||
| 39 | * "limit": 50, |
||
| 40 | * “first”: { |
||
| 41 | * “href”: "https://api.mycompany.com/v1/users" |
||
| 42 | * }, |
||
| 43 | * “prev”: { |
||
| 44 | * “href”: "https://api.mycompany.com/v1/users" |
||
| 45 | * }, |
||
| 46 | * “next”: { |
||
| 47 | * “href”: "https://api.mycompany.com/v1/users?offset=100&limit=50" |
||
| 48 | * }, |
||
| 49 | * “last”: { |
||
| 50 | * “href”: "https://api.mycompany.com/v1/users?offset=50&limit=50" |
||
| 51 | * }, |
||
| 52 | * "items": [ |
||
| 53 | * { |
||
| 54 | * ... user 51 name/value pairs ... |
||
| 55 | * }, |
||
| 56 | * ..., |
||
| 57 | * { |
||
| 58 | * ... user 100 name/value pairs ... |
||
| 59 | * } |
||
| 60 | * } |
||
| 61 | * } |
||
| 62 | */ |
||
| 63 | 1 | public function getGenericContext() |
|
| 68 | } |
||
| 69 |