PHP 클래스 BookStack\Services\AttachmentService

상속: extends UploadService
파일 보기 프로젝트 열기: ssddanbrown/bookstack

공개 메소드들

메소드 설명
deleteFile ( Attachment $attachment ) Delete a File from the database and storage.
getAttachmentFromStorage ( Attachment $attachment ) : string Get an attachment from storage.
saveNewFromLink ( string $name, string $link, integer $page_id ) : Attachment Save a new File attachment from a given link and name.
saveNewUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, integer $page_id ) : Attachment Store a new attachment upon user upload.
saveUpdatedUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, Attachment $attachment ) : Attachment Store a upload, saving to a file and deleting any existing uploads attached to that file.
updateFile ( Attachment $attachment, $requestData ) : Attachment Update the details of a file.
updateFileOrderWithinPage ( array $attachmentList, $pageId ) Updates the file ordering for a listing of attached files.

보호된 메소드들

메소드 설명
deleteFileInStorage ( Attachment $attachment ) Delete a file from the filesystem it sits on.
putFileInStorage ( $attachmentName, Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile ) : string Store a file in storage with the given filename

비공개 메소드들

메소드 설명
getStorageBasePath ( ) : string Get the file storage base path, amended for storage type.

메소드 상세

deleteFile() 공개 메소드

Delete a File from the database and storage.
public deleteFile ( Attachment $attachment )
$attachment BookStack\Attachment

deleteFileInStorage() 보호된 메소드

Cleans any empty leftover folders.
protected deleteFileInStorage ( Attachment $attachment )
$attachment BookStack\Attachment

getAttachmentFromStorage() 공개 메소드

Get an attachment from storage.
public getAttachmentFromStorage ( Attachment $attachment ) : string
$attachment BookStack\Attachment
리턴 string

putFileInStorage() 보호된 메소드

Store a file in storage with the given filename
protected putFileInStorage ( $attachmentName, Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile ) : string
$attachmentName
$uploadedFile Symfony\Component\HttpFoundation\File\UploadedFile
리턴 string

saveNewUpload() 공개 메소드

Store a new attachment upon user upload.
public saveNewUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, integer $page_id ) : Attachment
$uploadedFile Symfony\Component\HttpFoundation\File\UploadedFile
$page_id integer
리턴 BookStack\Attachment

saveUpdatedUpload() 공개 메소드

Store a upload, saving to a file and deleting any existing uploads attached to that file.
public saveUpdatedUpload ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, Attachment $attachment ) : Attachment
$uploadedFile Symfony\Component\HttpFoundation\File\UploadedFile
$attachment BookStack\Attachment
리턴 BookStack\Attachment

updateFile() 공개 메소드

Update the details of a file.
public updateFile ( Attachment $attachment, $requestData ) : Attachment
$attachment BookStack\Attachment
$requestData
리턴 BookStack\Attachment

updateFileOrderWithinPage() 공개 메소드

Updates the file ordering for a listing of attached files.
public updateFileOrderWithinPage ( array $attachmentList, $pageId )
$attachmentList array
$pageId