class DocumentFactory (View source)

Create documents from UploadedFile.

Factory methods do not flush, only persist in order to use it in loops.

Methods

__construct(File $file, EntityManager $em, EventDispatcherInterface $dispatcher, Packages $packages, Folder $folder = null, LoggerInterface $logger = null)

DocumentFactory constructor.

parseSvgMimeType(Document $document)

Special case for SVG without XML statement.

null|Document
getDocument()

Create a document from UploadedFile, Be careful, this method does not flush, only persists current Document.

dispatchEvents(Document $document)

No description

updateDocument(Document $document)

Updates a document from UploadedFile, Be careful, this method does not flush.

string
getFileName()

No description

Details

__construct(File $file, EntityManager $em, EventDispatcherInterface $dispatcher, Packages $packages, Folder $folder = null, LoggerInterface $logger = null)

DocumentFactory constructor.

Parameters

File $file
EntityManager $em
EventDispatcherInterface $dispatcher
Packages $packages
Folder $folder
LoggerInterface $logger

protected parseSvgMimeType(Document $document)

Special case for SVG without XML statement.

Parameters

Document $document

null|Document getDocument()

Create a document from UploadedFile, Be careful, this method does not flush, only persists current Document.

Return Value

null|Document

protected dispatchEvents(Document $document)

Parameters

Document $document

Document updateDocument(Document $document)

Updates a document from UploadedFile, Be careful, this method does not flush.

Parameters

Document $document

Return Value

Document

protected string getFileName()

Return Value

string