silverstripe-framework/api/VersionedRestfulServer.php
Sean Harvey 0882741f54 API CHANGE Renamed setModel for DataModel instances to setDataModel for
semantics, and also to allow a field name called "Model"
2012-05-01 14:45:44 +12:00

24 lines
497 B
PHP

<?php
/**
* Simple wrapper to allow access to the live site via REST
*
* @package framework
* @subpackage integration
*/
class VersionedRestfulServer extends Controller {
static $allowed_actions = array(
'index'
);
function handleRequest(SS_HTTPRequest $request, DataModel $model) {
$this->setDataModel($model);
Versioned::reading_stage('Live');
$restfulserver = new RestfulServer();
$response = $restfulserver->handleRequest($request, $model);
return $response;
}
}