Document
class Document extends BaseCachedFile implements EventSubscriberInterface
Document management actions. This class handles document processing an caching.
Basically, documents are stored outside the web space (by default in local/media/documents), and cached in the web space (by default in web/local/documents).
In the documents caches directory, a subdirectory for documents categories (eg. product, category, folder, etc.) is automatically created, and the cached document is created here. Plugin may use their own subdirectory as required.
The cached document name contains a hash of the processing options, and the original (normalized) name of the document.
A copy (or symbolic link, by default) of the original document is always created in the cache, so that the full resolution document is always available.
If a problem occurs, an DocumentException may be thrown.
Constants
CONFIG_DELIVERY_MODE |
|
Methods
Toggle visibility for an object
Clear the file cache. Is a subdirectory is specified, only this directory is cleared.
Take care of saving a file in the database and file storage
Take care of updating file in the database and file storage
Deleting file in the database and in storage
No description
No description
Process document and write the result in the document cache.
{@inheritdoc}
Details
in
BaseAction at line 130
mixed
genericToggleVisibility(
ModelCriteria $query,
ToggleVisibilityEvent $event,
EventDispatcherInterface $dispatcher = null)
Toggle visibility for an object
in
BaseCachedFile at line 49
__construct(
FileManager $fileManager)
in
BaseCachedFile at line 66
clearCache(
CachedFileEvent $event)
Clear the file cache. Is a subdirectory is specified, only this directory is cleared.
If no directory is specified, the whole cache is cleared. Only files are deleted, directories will remain.
in
BaseCachedFile at line 199
saveFile(
FileCreateOrUpdateEvent $event)
Take care of saving a file in the database and file storage
in
BaseCachedFile at line 239
updateFile(
FileCreateOrUpdateEvent $event)
Take care of updating file in the database and file storage
in
BaseCachedFile at line 262
deleteFile(
FileDeleteEvent $event)
Deleting file in the database and in storage
in
BaseCachedFile at line 267
updatePosition(
UpdateFilePositionEvent $event, $eventName,
EventDispatcherInterface $dispatcher)
in
BaseCachedFile at line 272
toggleVisibility(
FileToggleVisibilityEvent $event, $eventName,
EventDispatcherInterface $dispatcher)
at line 70
processDocument(
DocumentEvent $event)
Process document and write the result in the document cache.
When the original document is required, create either a symbolic link with the original document in the cache dir, or copy it in the cache dir if it's not already done.
This method updates the cachefilepath and file_url attributes of the event
at line 111
static
getSubscribedEvents()
{@inheritdoc}