class DocumentLifeCycleSubscriber implements EventSubscriber (View source)

Handle file management on documents lifecycle events.

Methods

__construct(FileAwareInterface $fileAware)

DocumentLifeCycleSubscriber constructor.

getSubscribedEvents()

{@inheritdoc}

postRemove(LifecycleEventArgs $args)

Unlink file after document has been deleted.

bool
cleanFileDirectory(DocumentInterface $document)

Remove document directory if there is no other file in it.

string
getDocumentPath(DocumentInterface $document)

No description

string
getDocumentFolderPath(DocumentInterface $document)

No description

Details

__construct(FileAwareInterface $fileAware)

DocumentLifeCycleSubscriber constructor.

Parameters

FileAwareInterface $fileAware

getSubscribedEvents()

{@inheritdoc}

postRemove(LifecycleEventArgs $args)

Unlink file after document has been deleted.

Parameters

LifecycleEventArgs $args

protected bool cleanFileDirectory(DocumentInterface $document)

Remove document directory if there is no other file in it.

Parameters

DocumentInterface $document

Return Value

bool

protected string getDocumentPath(DocumentInterface $document)

Parameters

DocumentInterface $document

Return Value

string

protected string getDocumentFolderPath(DocumentInterface $document)

Parameters

DocumentInterface $document

Return Value

string