1 | <?php |
||
2 | |||
3 | namespace SilverStripe\RestfulServer; |
||
4 | |||
5 | /** |
||
6 | * Restful server handler for a SS_List |
||
7 | */ |
||
8 | class RestfulServerList |
||
9 | { |
||
10 | private static $url_handlers = array( |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
11 | '#ID' => 'handleItem', |
||
12 | ); |
||
13 | |||
14 | public function __construct($list) |
||
15 | { |
||
16 | $this->list = $list; |
||
0 ignored issues
–
show
|
|||
17 | } |
||
18 | |||
19 | public function handleItem($request) |
||
20 | { |
||
21 | return new RestfulServerItem($this->list->getById($request->param('ID'))); |
||
22 | } |
||
23 | } |
||
24 |