Model/DocumentService.php
/**
     * Upload document
     * @param  Document $document [description]
     * @throws If the given document's class doesn't implement DocumentInterface
     */
Upload document
@param  Document $document [description]
@throws If the given document's class doesn't implement DocumentInterface
Upload document @param Document $document [ description ] @throws If the given document ' s class doesn ' t implement DocumentInterface
public function upload(Document $document)
    {
        if( ! ($document instanceOf DocumentInterface) ){
            throw new DocumentException([], "Document doesn't implements DocumentInterface", 1);
        }
        $this->get('vich_uploader.upload_handler')->upload($document, $document->getFileField());
    }
public function upload ( Document $ document ) { if ( ! ( $ document instanceOf DocumentInterface ) ) { throw new DocumentException ( [ ] , " Document doesn't implements DocumentInterface " , 1 ) ; } $ this -> get ( 'vich_uploader.upload_handler' ) -> upload ( $ document , $ document -> getFileField ( ) ) ; }
Upload document
 @param  Document $document [description]
 @throws If the given document's class doesn't implement DocumentInterface
Upload document @param Document $document [ description ] @throws If the given document ' s class doesn ' t implement DocumentInterface