PHP Класс Common\Doctrine\ValueObject\AbstractImage

You need to implement the method getUploadDir. When using this class in an entity certain life cycle callbacks should be called prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() upload for @ORM\PostPersist() and @ORM\PostUpdate() remove for @ORM\PostRemove() The following things are optional A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant By default we will use the fork way for image sizes (source, 100X100 etc) if you don't want it set GENERATE_THUMBNAILS to false
Наследование: extends AbstractFile
Показать файл Открыть проект

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

Метод Описание
getAbsolutePath ( string | null $subDirectory = null ) : string | null
getFallbackImage ( ) : null | string
getWebPath ( string | null $subDirectory = null ) : string | null
remove ( ) This function should be called for the life cycle event @ORM\PostRemove()
upload ( ) This function should be called for the life cycle events @ORM\PostPersist() and @ORM\PostUpdate()

Защищенные методы

Метод Описание
getUploadRootDir ( string | null $subDirectory = null ) : string
removeOldFile ( ) This will remove the old image and if needed the generated thumbnails
writeFileToDisk ( )

Описание методов

getAbsolutePath() публичный Метод

public getAbsolutePath ( string | null $subDirectory = null ) : string | null
$subDirectory string | null
Результат string | null

getFallbackImage() публичный Метод

public getFallbackImage ( ) : null | string
Результат null | string

getUploadRootDir() защищенный Метод

protected getUploadRootDir ( string | null $subDirectory = null ) : string
$subDirectory string | null
Результат string

getWebPath() публичный Метод

public getWebPath ( string | null $subDirectory = null ) : string | null
$subDirectory string | null
Результат string | null

remove() публичный Метод

This function should be called for the life cycle event @ORM\PostRemove()
public remove ( )

removeOldFile() защищенный Метод

This will remove the old image and if needed the generated thumbnails
protected removeOldFile ( )

upload() публичный Метод

This function should be called for the life cycle events @ORM\PostPersist() and @ORM\PostUpdate()
public upload ( )

writeFileToDisk() защищенный Метод

protected writeFileToDisk ( )