class DocumentHandler extends AbstractHandler (View source)

Handle operations with documents entities.

Properties

protected ObjectManager $objectManager from AbstractHandler
protected Document $document
protected Packages $packages

Methods

ObjectManager
getObjectManager()

No description

setObjectManager(ObjectManager $objectManager)

No description

__construct(ObjectManager $objectManager, Packages $packages)

AbstractHandler constructor.

int
cleanPositions(bool $setPositions = true)

Clean positions for current entity siblings.

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.

getDocument()

No description

setDocument(Document $document)

No description

Details

ObjectManager getObjectManager()

Return Value

ObjectManager

AbstractHandler setObjectManager(ObjectManager $objectManager)

Parameters

ObjectManager $objectManager

Return Value

AbstractHandler

__construct(ObjectManager $objectManager, Packages $packages)

AbstractHandler constructor.

Parameters

ObjectManager $objectManager
Packages $packages

int cleanPositions(bool $setPositions = true)

Clean positions for current entity siblings.

Parameters

bool $setPositions

Return Value

int Return the next position after the last entity

makePrivate()

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

You must explicitly call flush after this method.

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.

Response getDownloadResponse()

Get a Response object to force download document.

This method works for both private and public documents.

Return Value

Response

array getFolders(Translation $translation = null)

Return documents folders with the same translation as current document.

Parameters

Translation $translation

Return Value

array

Document getDocument()

Return Value

Document

DocumentHandler setDocument(Document $document)

Parameters

Document $document

Return Value

DocumentHandler