class DocumentFactory extends AbstractDocumentFactory (View source)

Create documents from UploadedFile.

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

Methods

__construct(EntityManager $em, EventDispatcherInterface $dispatcher, Packages $packages, LoggerInterface $logger = null)

DocumentFactory constructor.

File
getFile()

No description

setFile(File $file)

No description

parseSvgMimeType(DocumentInterface $document)

Special case for SVG without XML statement.

getDocument()

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

dispatchEvents(DocumentInterface $document)

No description

updateDocument(DocumentInterface $document)

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

string
getFileName()

No description

Details

__construct(EntityManager $em, EventDispatcherInterface $dispatcher, Packages $packages, LoggerInterface $logger = null)

DocumentFactory constructor.

Parameters

EntityManager $em
EventDispatcherInterface $dispatcher
Packages $packages
LoggerInterface $logger

File getFile()

Return Value

File

AbstractDocumentFactory setFile(File $file)

Parameters

File $file

Return Value

AbstractDocumentFactory

protected parseSvgMimeType(DocumentInterface $document)

Special case for SVG without XML statement.

Parameters

DocumentInterface $document

protected DocumentInterface createDocument()

Return Value

DocumentInterface

null|DocumentInterface getDocument()

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

Return Value

null|DocumentInterface

protected dispatchEvents(DocumentInterface $document)

Parameters

DocumentInterface $document

DocumentInterface updateDocument(DocumentInterface $document)

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

Parameters

DocumentInterface $document

Return Value

DocumentInterface

protected string getFileName()

Return Value

string