PHP Class Controllers\xAPI\DocumentController

Inheritance: extends BaseController
Datei anzeigen Open project: learninglocker/learninglocker Class Usage Examples

Protected Properties

Property Type Description
$document Defines properties to be set to constructor parameters.
$document_type Defines properties to be set by sub classes.
$identifier Defines properties to be set by sub classes.
$lrs Defines properties to be set by the constructor.
$method Defines properties to be set by the constructor.
$optional Defines properties to be set by sub classes.
$params Defines properties to be set by the constructor.
$required Defines properties to be set by sub classes.

Public Methods

Method Description
__construct ( Locker\Repository\Document\DocumentRepository $document ) Construct a new DocumentController.
checkParams ( AssocArray[Key=>Type] $required = [], AssocArray[Key=>Type] $optional = [], mixed $data = null ) : AssocArray Checks and filters $data against $required and $optional parameters.
checkTypes ( $name, $value, $expected_types ) Check that $value is $expected_types.
destroy ( ) : Response Deletes a document.
documentResponse ( mixed $data ) : Response Generates content response.
getAttachedContent ( string $name = 'content' ) : Array Retrieves attached file content
getPostContent ( String $name ) : Array Checks for files, then retrieves the stored param.
getUpdatedValue ( ) : String Checks and gets the updated header.
index ( )
show ( ) : DocumentResponse Returns (GETs) a single document.
store ( ) : Response Creates (POSTs) a new document.
update ( ) : Response Creates (PUTs) a new document.
validateTimestamp ( string $timestamp ) : boolean Validates a $timestamp.

Protected Methods

Method Description
completeDelete ( mixed $data = null, boolean $singleDelete = false ) : Response Completes deletion of $data.
getIndexData ( $additional = [] )
getShowData ( )

Private Methods

Method Description
checkFormContentType ( string $contentType = '' ) : boolean Determines if $contentType is a form.

Method Details

__construct() public method

Construct a new DocumentController.
public __construct ( Locker\Repository\Document\DocumentRepository $document )
$document Locker\Repository\Document\DocumentRepository

checkParams() public method

Checks and filters $data against $required and $optional parameters.
public checkParams ( AssocArray[Key=>Type] $required = [], AssocArray[Key=>Type] $optional = [], mixed $data = null ) : AssocArray
$required AssocArray[Key=>Type]
$optional AssocArray[Key=>Type]
$data mixed Data
return AssocArray Filtered data.

checkTypes() public method

Check that $value is $expected_types.
public checkTypes ( $name, $value, $expected_types )

completeDelete() protected method

Completes deletion of $data.
protected completeDelete ( mixed $data = null, boolean $singleDelete = false ) : Response
$data mixed
$singleDelete boolean determines if deleting multiple objects.
return Response

destroy() public method

Deletes a document.
public destroy ( ) : Response
return Response

documentResponse() public method

Generates content response.
public documentResponse ( mixed $data ) : Response
$data mixed used to select the Document.
return Response

getAttachedContent() public method

Retrieves attached file content
public getAttachedContent ( string $name = 'content' ) : Array
$name string Field name
return Array

getIndexData() protected method

protected getIndexData ( $additional = [] )

getPostContent() public method

Checks for files, then retrieves the stored param.
public getPostContent ( String $name ) : Array
$name String Field name
return Array

getShowData() protected method

protected getShowData ( )

getUpdatedValue() public method

Checks and gets the updated header.
public getUpdatedValue ( ) : String
return String The updated timestamp ISO 8601 formatted.

index() public method

public index ( )

show() public method

Returns (GETs) a single document.
public show ( ) : DocumentResponse
return DocumentResponse

store() public method

Creates (POSTs) a new document.
public store ( ) : Response
return Response

update() public method

Creates (PUTs) a new document.
public update ( ) : Response
return Response

validateTimestamp() public method

Validates a $timestamp.
public validateTimestamp ( string $timestamp ) : boolean
$timestamp string
return boolean Validity of the timestamp.

Property Details

$document protected_oe property

Defines properties to be set to constructor parameters.
protected $document

$document_type protected_oe property

Defines properties to be set by sub classes.
protected $document_type

$identifier protected_oe property

Defines properties to be set by sub classes.
protected $identifier

$lrs protected_oe property

Defines properties to be set by the constructor.
protected $lrs

$method protected_oe property

Defines properties to be set by the constructor.
protected $method

$optional protected_oe property

Defines properties to be set by sub classes.
protected $optional

$params protected_oe property

Defines properties to be set by the constructor.
protected $params

$required protected_oe property

Defines properties to be set by sub classes.
protected $required