silverstripe-framework/api/VersionedRestfulServer.php
Sam Minnee 7fbb919ce8 API CHANGE: Introduce DataModel object, as a representation of the project's entire data model, and tie it to $this->model an all DataObjects, Controllers, and RequestHandlers for easy non-static access.
API CHANGE: Add DataList::newObject(), which creates a new object on that DataList.
API CHANGE: RequestHandler::handleRequest() now needs to handle a $model argument, if you override it.
2011-05-01 17:33:02 +12:00

24 lines
469 B
PHP

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