PHP Class KickAssets_FileRequest

Author: Uncle Cheese ([email protected])
Inheritance: extends RequestHandler
显示文件 Open project: unclecheese/silverstripe-kickassets Class Usage Examples

Protected Properties

Property Type Description
$file File The file that this controller will be editing/reading/deleting
$parent KickAssets The parent controller

Public Methods

Method Description
__construct ( KickAssets $parent, File $file ) Constructor, sets the parent and file
handleDelete ( SS_HTTPRequest $r ) : SS_HTTPResponse Deletes the file bound to this controller
handleRead ( SS_HTTPRequest $r ) : SS_HTTPResponse Serves up the details for the file bound to this controller
handleUpdate ( SS_HTTPRequest $r ) : SS_HTTPResponse Applies edits to the file bound to this controller

Protected Methods

Method Description
JSONResponse ( array $json = null ) Helper method for generating an HTTPResponse based on given JSON
buildJSON ( ) : array Adds new properties to the parent (KickAssets) file JSON

Method Details

JSONResponse() protected method

Helper method for generating an HTTPResponse based on given JSON
protected JSONResponse ( array $json = null )
$json array

__construct() public method

Constructor, sets the parent and file
public __construct ( KickAssets $parent, File $file )
$parent KickAssets
$file File

buildJSON() protected method

Adds new properties to the parent (KickAssets) file JSON
protected buildJSON ( ) : array
return array

handleDelete() public method

Deletes the file bound to this controller
public handleDelete ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
return SS_HTTPResponse

handleRead() public method

Serves up the details for the file bound to this controller
public handleRead ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
return SS_HTTPResponse

handleUpdate() public method

Applies edits to the file bound to this controller
public handleUpdate ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
return SS_HTTPResponse

Property Details

$file protected_oe property

The file that this controller will be editing/reading/deleting
protected File $file
return File

$parent protected_oe property

The parent controller
protected KickAssets $parent
return KickAssets