PHP Class PartKeepr\UploadedFileBundle\Services\UploadedFileService

Inheritance: extends Symfony\Component\DependencyInjection\ContainerAware
Show file Open project: partkeepr/PartKeepr Class Usage Examples

Protected Properties

Property Type Description
$container Symfony\Component\DependencyInjection\Container

Public Methods

Method Description
__construct ( Symfony\Component\DependencyInjection\Container $container )
delete ( UploadedFile $file )
getStorage ( UploadedFile $file ) : Gaufrette\Filesystem
getStorageDirectory ( UploadedFile $file ) : string Returns the storage directory for a given UploadedFile.
replace ( UploadedFile $file, File $filesystemFile ) Replaces the current file with a new file.
replaceFromData ( UploadedFile $file, $data, $filename )
replaceFromFilesystem ( UploadedFile $file, File $filesystemFile ) Replaces the current file with a new file.
replaceFromURL ( UploadedFile $file, string $url ) Replaces the file from an URL. Does some tricks to avoid 403 forbidden on some sites, like setting a proper browser identification.
replaceFromUploadedFile ( UploadedFile $target, UploadedFile $source ) Replaces an existing uploaded file with another uploaded file.

Method Details

__construct() public method

public __construct ( Symfony\Component\DependencyInjection\Container $container )
$container Symfony\Component\DependencyInjection\Container

delete() public method

public delete ( UploadedFile $file )
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile

getStorage() public method

public getStorage ( UploadedFile $file ) : Gaufrette\Filesystem
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile
return Gaufrette\Filesystem

getStorageDirectory() public method

Returns the storage directory for a given UploadedFile.
public getStorageDirectory ( UploadedFile $file ) : string
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile The file to get the storage directory for
return string The storage directory for the type of the given UploadedFile

replace() public method

Replaces the current file with a new file.
public replace ( UploadedFile $file, File $filesystemFile )
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile The target file
$filesystemFile Symfony\Component\HttpFoundation\File\File The source file

replaceFromData() public method

public replaceFromData ( UploadedFile $file, $data, $filename )
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile

replaceFromFilesystem() public method

Replaces the current file with a new file.
public replaceFromFilesystem ( UploadedFile $file, File $filesystemFile )
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile The target file
$filesystemFile Symfony\Component\HttpFoundation\File\File The source file

replaceFromURL() public method

Replaces the file from an URL. Does some tricks to avoid 403 forbidden on some sites, like setting a proper browser identification.
public replaceFromURL ( UploadedFile $file, string $url )
$file PartKeepr\UploadedFileBundle\Entity\UploadedFile The target file
$url string The URL to replace from

replaceFromUploadedFile() public method

Replaces an existing uploaded file with another uploaded file.
public replaceFromUploadedFile ( UploadedFile $target, UploadedFile $source )
$target PartKeepr\UploadedFileBundle\Entity\UploadedFile The target file
$source PartKeepr\UploadedFileBundle\Entity\UploadedFile The source file

Property Details

$container protected property

protected Container,Symfony\Component\DependencyInjection $container
return Symfony\Component\DependencyInjection\Container