Property | Type | Description | |
---|---|---|---|
$file | Symfony\Component\HttpFoundation\File\UploadedFile | ||
$fileName | string | ||
$oldFileName | string |
Method | Description | |
---|---|---|
__toString ( ) : string | Returns a string representation of the image. | |
fromString ( string $fileName ) : static | ||
fromUploadedFile ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile = null ) : static | ||
getAbsolutePath ( ) : string | null | ||
getFile ( ) : Symfony\Component\HttpFoundation\File\UploadedFile | Get file. | |
getFileName ( ) : string | ||
getWebPath ( ) : string | ||
markForDeletion ( ) | The next time doctrine saves this to the database the file will be removed | |
prepareToUpload ( ) | This function should be called for the life cycle events @ORM\PrePersist() and @ORM\PreUpdate() | |
remove ( ) | This function should be called for the life cycle event @ORM\PostRemove() | |
setFile ( Symfony\Component\HttpFoundation\File\UploadedFile $file = null ) : static | Sets file. | |
upload ( ) | This function should be called for the life cycle events @ORM\PostPersist() and @ORM\PostUpdate() |
Method | Description | |
---|---|---|
__construct ( string $fileName ) | ||
getTrimmedUploadDir ( ) : string | ||
getUploadDir ( ) : string | The dir in the web folder where the file needs to be uploaded. | |
getUploadRootDir ( ) : string | ||
removeOldFile ( ) | This will remove the old file, can be extended to add extra functionality | |
writeFileToDisk ( ) | if there is an error when moving the file, an exception will be automatically thrown by move(). This will properly prevent the entity from being persisted to the database on error |
public __toString ( ) : string | ||
return | string |
public static fromString ( string $fileName ) : static | ||
$fileName | string | |
return | static |
public static fromUploadedFile ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile = null ) : static | ||
$uploadedFile | Symfony\Component\HttpFoundation\File\UploadedFile | |
return | static |
public getFile ( ) : Symfony\Component\HttpFoundation\File\UploadedFile | ||
return | Symfony\Component\HttpFoundation\File\UploadedFile |
abstract protected getUploadDir ( ) : string | ||
return | string |
public markForDeletion ( ) |
public prepareToUpload ( ) |
public remove ( ) |
protected removeOldFile ( ) |
public setFile ( Symfony\Component\HttpFoundation\File\UploadedFile $file = null ) : static | ||
$file | Symfony\Component\HttpFoundation\File\UploadedFile | |
return | static |
public upload ( ) |
protected writeFileToDisk ( ) |
protected UploadedFile,Symfony\Component\HttpFoundation\File $file | ||
return | Symfony\Component\HttpFoundation\File\UploadedFile |