PHP Класс Newscoop\Services\AttachmentService

Показать файл Открыть проект

Открытые методы

Метод Описание
__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