PHP 클래스 Newscoop\Services\AttachmentService

파일 보기 프로젝트 열기: sourcefabric/newscoop

공개 메소드들

메소드 설명
__construct ( array $config, EntityManager $em, Router $router, UserService $userService )
addAttachmentToArticle ( Article $article, Attachment $attachment )
getAttachmentUrl ( $attachment )
getStorageLocation ( Attachment $attachment ) : string Get attachment storage location
getUnedited ( integer $userId ) : array Return the ids of the file not edited yet.
remove ( Attachment $attachment )
removeAttachmentFormArticle ( Article $article, Attachment $attachment )
upload ( Symfony\Component\HttpFoundation\File\UploadedFile $file, string $descriptionText, Language $language, array $attributes, Attachment $attachment = null ) : Attachment Upload new attachment

비공개 메소드들

메소드 설명
fillAttachment ( Attachment $attachment, $attributes )
getFileName ( Attachment $attachment ) : string Get new attachment file name
getLevel1DirectoryName ( Attachment $attachment ) : string Get fist level directory name
getLevel2DirectoryName ( Attachment $attachment ) : string Get second level directory name
makeDirectories ( Attachment $attachment ) : string Make directories for attachments

메소드 상세

__construct() 공개 메소드

public __construct ( array $config, EntityManager $em, Router $router, UserService $userService )
$config array
$em Doctrine\ORM\EntityManager
$router Symfony\Component\Routing\Router
$userService UserService

addAttachmentToArticle() 공개 메소드

public addAttachmentToArticle ( Article $article, Attachment $attachment )
$article Newscoop\Entity\Article
$attachment Newscoop\Entity\Attachment

getAttachmentUrl() 공개 메소드

public getAttachmentUrl ( $attachment )

getStorageLocation() 공개 메소드

Get attachment storage location
public getStorageLocation ( Attachment $attachment ) : string
$attachment Newscoop\Entity\Attachment
리턴 string

getUnedited() 공개 메소드

Return the ids of the file not edited yet.
public getUnedited ( integer $userId ) : array
$userId integer User id
리턴 array

remove() 공개 메소드

public remove ( Attachment $attachment )
$attachment Newscoop\Entity\Attachment

removeAttachmentFormArticle() 공개 메소드

public removeAttachmentFormArticle ( Article $article, Attachment $attachment )
$article Newscoop\Entity\Article
$attachment Newscoop\Entity\Attachment

upload() 공개 메소드

Upload new attachment
public upload ( Symfony\Component\HttpFoundation\File\UploadedFile $file, string $descriptionText, Language $language, array $attributes, Attachment $attachment = null ) : Attachment
$file Symfony\Component\HttpFoundation\File\UploadedFile
$descriptionText string
$language Newscoop\Entity\Language
$attributes array
$attachment Newscoop\Entity\Attachment
리턴 Newscoop\Entity\Attachment