ResizeImage
in package
implements
ResizeImageInterface
Table of Contents
Interfaces
Constants
- SIZE = ['75', '100', '150', '240', '500', '1024']
- SQUARE_SIZE = ['50x50', '120x120', '200x200']
Properties
- $extra : array<string|int, mixed>
- $fileName : string|null
- $image : mixed
- $imageHeight : int
- $imageWidth : int
- $itemType : string|null
- $options : array<string|int, mixed>
- $originalName : string|null
- $path : mixed|string
- path to.
- $serverId : mixed|string
- $sizes : array<string|int, int>
- $squareSizes : array<string|int, int>
- $user : Entity|null
Methods
- createFile() : StorageFile
- createThumb() : array<string|int, mixed>|null
- getFileName() : string
- getPrefixPath() : string
- getSizes() : array<string|int, string>
- getSquareSizes() : array<string|int, int>
- setExtra() : ResizeImage
- setFileName() : ResizeImage
- setImage() : static
- setItemType() : $this
- setOptions() : static
- setOriginalName() : $this
- setPath() : static
- setServerId() : ResizeImage
- setSizes() : static
- setSquareSizes() : self
- setUser() : $this
- getResizeSize() : array<string|int, mixed>|null
Constants
SIZE
public
mixed
SIZE
= ['75', '100', '150', '240', '500', '1024']
SQUARE_SIZE
public
mixed
SQUARE_SIZE
= ['50x50', '120x120', '200x200']
Properties
$extra
private
array<string|int, mixed>
$extra
= []
$fileName
private
string|null
$fileName
= null
$image
private
mixed
$image
$imageHeight
private
int
$imageHeight
= 0
$imageWidth
private
int
$imageWidth
= 0
$itemType
private
string|null
$itemType
= null
$options
private
array<string|int, mixed>
$options
= ['visibility' => 'public']
$originalName
private
string|null
$originalName
= null
$path
path to.
private
mixed|string
$path
= 'photo'
$serverId
private
mixed|string
$serverId
= 'photo'
$sizes
private
array<string|int, int>
$sizes
= self::SIZE
$squareSizes
private
array<string|int, int>
$squareSizes
= self::SQUARE_SIZE
$user
private
Entity|null
$user
= null
Methods
createFile()
public
createFile() : StorageFile
Return values
StorageFilecreateThumb()
public
createThumb(string $variant, mixed $originalId, bool $forceCreate, Closure $callback) : array<string|int, mixed>|null
Parameters
- $variant : string
- $originalId : mixed
- $forceCreate : bool
- $callback : Closure
Return values
array<string|int, mixed>|nullgetFileName()
public
getFileName() : string
Return values
stringgetPrefixPath()
public
getPrefixPath() : string
Return values
stringgetSizes()
public
getSizes() : array<string|int, string>
Return values
array<string|int, string>getSquareSizes()
public
getSquareSizes() : array<string|int, int>
Return values
array<string|int, int>setExtra()
public
setExtra(array<string|int, mixed> $extra) : ResizeImage
Parameters
- $extra : array<string|int, mixed>
Return values
ResizeImagesetFileName()
public
setFileName(string $fileName) : ResizeImage
Parameters
- $fileName : string
Return values
ResizeImagesetImage()
public
setImage(mixed $imageFile) : static
Parameters
- $imageFile : mixed
Return values
staticsetItemType()
public
setItemType(string|null $itemType) : $this
Parameters
- $itemType : string|null
Return values
$thissetOptions()
public
setOptions(array<string|int, mixed>|array<string|int, string> $options) : static
Parameters
- $options : array<string|int, mixed>|array<string|int, string>
Return values
staticsetOriginalName()
public
setOriginalName(string $clientOriginalName) : $this
Parameters
- $clientOriginalName : string
Return values
$thissetPath()
public
setPath(string $path) : static
Parameters
- $path : string
Return values
staticsetServerId()
public
setServerId(mixed|string $serverId) : ResizeImage
Parameters
- $serverId : mixed|string
Return values
ResizeImagesetSizes()
public
setSizes(array<string|int, int> $sizes) : static
Parameters
- $sizes : array<string|int, int>
Return values
staticsetSquareSizes()
public
setSquareSizes(array<string|int, int> $squareSizes) : self
Parameters
- $squareSizes : array<string|int, int>
Return values
selfsetUser()
public
setUser(Entity|null $user) : $this
Parameters
- $user : Entity|null
Return values
$thisgetResizeSize()
private
getResizeSize(int $orgWidth, int $orgHeight, int $newWidth, int $newHeight) : array<string|int, mixed>|null
Parameters
- $orgWidth : int
- $orgHeight : int
- $newWidth : int
- $newHeight : int