Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
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( |
|
11 |
'#ID' => 'handleItem', |
|
12 |
);
|
|
13 |
|
|
14 |
public function __construct($list) |
|
15 |
{
|
|
16 |
$this->list = $list; |
|
17 |
}
|
|
18 |
|
|
19 |
public function handleItem($request) |
|
20 |
{
|
|
21 |
return new RestfulServerItem($this->list->getById($request->param('ID'))); |
|
22 |
}
|
|
23 |
}
|
Read our documentation on viewing source code .