mirror of
https://github.com/silverstripe/silverstripe-restfulserver
synced 2024-10-22 12:05:58 +00:00
24 lines
420 B
PHP
24 lines
420 B
PHP
<?php
|
|
|
|
namespace SilverStripe\RestfulServer;
|
|
|
|
/**
|
|
* Restful server handler for a SS_List
|
|
*/
|
|
class RestfulServerList
|
|
{
|
|
private static $url_handlers = array(
|
|
'#ID' => 'handleItem',
|
|
);
|
|
|
|
public function __construct($list)
|
|
{
|
|
$this->list = $list;
|
|
}
|
|
|
|
public function handleItem($request)
|
|
{
|
|
return new RestfulServerItem($this->list->getById($request->param('ID')));
|
|
}
|
|
}
|