Beta version

class DocumentHandler

Handle operations with documents entities.

Methods

__construct(Document $document)

Create a new document handler with document to handle.

makePrivate()

Make current document private moving its file to the secured /files/private folder.

makePublic()

Make current document public moving off its file from the secured /files/private folder into /files folder.

Response
getDownloadResponse()

Get a Response object to force download document.

array
getFolders(Translation $translation = null)

Return documents folders with the same translation as current document.

Details

at line 52
__construct(Document $document)

Create a new document handler with document to handle.

Parameters

Document $document

at line 63
makePrivate()

Make current document private moving its file to the secured /files/private folder.

You must explicitly call flush after this method.

at line 108
makePublic()

Make current document public moving off its file from the secured /files/private folder into /files folder.

You must explicitly call flush after this method.

at line 157
Response getDownloadResponse()

Get a Response object to force download document.

This method works for both private and public documents.

Be careful, this method will send headers.

Return Value

Response

at line 190
array getFolders(Translation $translation = null)

Return documents folders with the same translation as current document.

Parameters

Translation $translation

Return Value

array