class Image extends Document implements PrimaryKeyInterface, Serializable

Image

Constants

VERSION

Version path on server

UPLOAD_DIR

Upload directory in server

Properties

protected string $name File name from Document
protected string $filePath File path on server from Document
protected float $fileSize File size from Document
protected string $code Unique identifier for image. Used for storing image's erp code

Methods

bool|string
image_resize(string $src, string $dst, int $width, int $height, int $crop = 0)

No description

from Helper
mixed
getName()

No description

from Document
setName(String $name)

No description

from Document
null|string
getAbsolutePath()

Get file absolute path on server

from Document
null|string
getWebPath()

Get full web path for file on server

from Document
null|string
getThumbPath()

Get thumbnail path on server

from Document
string
getDayFolder()

Get folder by date

from Document
string
getUploadDir()

Get rid of the DIR so it doesn't screw up when displaying uploaded doc/image inklimacold. the view.

from Document
string
getUploadRootDir()

Get upload root dir full path on server

from Document
static string
getWebDir()

Get web directory on server

from Document
static string
getMainBlobDirectoryForUpload()

Get main blob directory for uploaded blob files

from Document
string
getServer(bool $override = false)

Get server path

from Document
false|int
saveToFile(string $base64String, null $imageCode = null)

Save base64 to file

from Document
bool|int
saveBlobToFile(mixed $blob)

Save blob object to file

from Document
false|int
uploadLanguageFileYML(string $base64String)

Upload language file from base64 string

from Document
setFileName(int $size, string $extension)

Set file name if file exists give it random name

from Document
string
createThumbnail(int $size, string $extension, array $data, string $type)

No description

from Document
string
getLanguageRootDir()

Get language translations root dir

from Document
string
getTmpDir()

Get temporary directory

from Document
int
uploadLanguageFile(string $locale, string $base64String)

No description

from Document
bool
is_excel(String $extension)

Check if is excel

from Document
string
getLanguageFilePath()

Get language file path

from Document
float
getPeakMemoryInMegabytes()

Get peak memory in megabytes

from Document
int
returnFileSize()

Return file size

from Document
null|string
getAbsolutePathWithVersion()

Get absolute path with version

from Document
null|string
getAbsolutePathWithoutName()

Get absolute path without name

from Document
float
getFileSize()

No description

from Document
setFileSize(float $fileSize)

No description

from Document
updateFileSize()

set file size

from Document
deleteFile()

No description

from Document
deleteLanguageFile()

No description

from Document
static File
uploadFile(UploadedFile $uploadedFile, string $uploadDir, null $prefix = null)

Upload file

from Document
static 
deleteUnusedBlobFiles(array $links, string $htmlString)

Delete unused blob files

from Document
static 
deleteUnusedBlockElementsImages(array $mediaLinks, string $htmlString)

No description

from Document
static 
removeOldFiles(string $uploadDir, string $format = 'Y-m-d-h')

Remove old files

from Document
string
createFolder()

A method that creates the appropriate day folder for every image uploaded

from Document
string
createProFolder()

Create project folder if it does not exist

from Document
__construct()

Image constructor.

Product|null
getProduct()

No description

setProduct(Product|null $product)

No description

Brand|null
getBrand()

No description

setBrand(Brand|null $brand)

No description

setProductAttributeValue(ProductAttributeValues|null $productAttributeValue)

No description

Category|null
getCategory()

No description

setCategory(Category|null $category)

No description

Category|null
getCategoryGallery()

No description

setCategoryGallery(Category|null $categoryGallery)

No description

setId(int $id)

No description

integer
getId()

No description

setPosition(string $position)

No description

string
getPosition()

Get position

string
getBase64Content()

No description

setBase64Content(string $base64Content)

No description

bool
isWatermarkImage()

No description

setWatermarkImage(bool $watermarkImage)

No description

int
getPriority()

No description

setPriority(int $priority)

No description

string
serialize()

(PHP 5 >= 5.1.0)
String representation of object

void
unserialize(string $serialized)

(PHP 5 >= 5.1.0)
Constructs the object

mixed
getThumbnails()

No description

setThumbnails(ArrayCollection $thumbnails)

No description

addThumbnail(Thumbnail $thumbnail)

No description

removeThumbnail(Thumbnail $thumbnail)

No description

createThumbnails()

Create thumbnails

bool
isNotResizable()

No description

setNotResizable(bool $notResizable)

No description

deleteAllThumbnailsFromFile()

No description

string
getFilePath()

No description

setFilePath(string $filePath)

No description

string
getCode()

No description

setCode(string $code)

No description

Details

in Helper at line 32
bool|string image_resize(string $src, string $dst, int $width, int $height, int $crop = 0)

Parameters

string $src
string $dst
int $width
int $height
int $crop

Return Value

bool|string

in Document at line 78
mixed getName()

Return Value

mixed

in Document at line 88
Document setName(String $name)

Parameters

String $name

Return Value

Document

in Document at line 101
null|string getAbsolutePath()

Get file absolute path on server

Return Value

null|string

in Document at line 116
null|string getWebPath()

Get full web path for file on server

Return Value

null|string

in Document at line 131
null|string getThumbPath()

Get thumbnail path on server

Return Value

null|string

in Document at line 145
string getDayFolder()

Get folder by date

Return Value

string

in Document at line 155
string getUploadDir()

Get rid of the DIR so it doesn't screw up when displaying uploaded doc/image inklimacold. the view.

Return Value

string

in Document at line 167
string getUploadRootDir()

Get upload root dir full path on server

Return Value

string

in Document at line 177
static string getWebDir()

Get web directory on server

Return Value

string

in Document at line 189
static string getMainBlobDirectoryForUpload()

Get main blob directory for uploaded blob files

Return Value

string

in Document at line 201
string getServer(bool $override = false)

Get server path

Parameters

bool $override

Return Value

string

in Document at line 235
false|int saveToFile(string $base64String, null $imageCode = null)

Save base64 to file

Parameters

string $base64String to decode and save to file
null $imageCode

Return Value

false|int

in Document at line 265
bool|int saveBlobToFile(mixed $blob)

Save blob object to file

Parameters

mixed $blob

Return Value

bool|int

in Document at line 284
false|int uploadLanguageFileYML(string $base64String)

Upload language file from base64 string

Parameters

string $base64String to decode and save to file

Return Value

false|int

in Document at line 313
setFileName(int $size, string $extension)

Set file name if file exists give it random name

Parameters

int $size
string $extension

in Document at line 332
string createThumbnail(int $size, string $extension, array $data, string $type)

Parameters

int $size
string $extension
array $data
string $type

Return Value

string

in Document at line 400
string getLanguageRootDir()

Get language translations root dir

Return Value

string

in Document at line 410
string getTmpDir()

Get temporary directory

Return Value

string

in Document at line 424
int uploadLanguageFile(string $locale, string $base64String)

Parameters

string $locale
string $base64String

Return Value

int

Exceptions

PHPExcel_Reader_Exception
PHPExcel_Exception

in Document at line 467
bool is_excel(String $extension)

Check if is excel

Parameters

String $extension

Return Value

bool

in Document at line 479
string getLanguageFilePath()

Get language file path

Return Value

string

in Document at line 489
float getPeakMemoryInMegabytes()

Get peak memory in megabytes

Return Value

float

in Document at line 501
int returnFileSize()

Return file size

Return Value

int

in Document at line 512
null|string getAbsolutePathWithVersion()

Get absolute path with version

Return Value

null|string

in Document at line 524
null|string getAbsolutePathWithoutName()

Get absolute path without name

Return Value

null|string

in Document at line 534
float getFileSize()

Return Value

float

in Document at line 542
setFileSize(float $fileSize)

Parameters

float $fileSize

in Document at line 550
updateFileSize()

set file size

in Document at line 558
deleteFile()

in Document at line 568
deleteLanguageFile()

in Document at line 584
static File uploadFile(UploadedFile $uploadedFile, string $uploadDir, null $prefix = null)

Upload file

Parameters

UploadedFile $uploadedFile
string $uploadDir
null $prefix

Return Value

File

in Document at line 609
static deleteUnusedBlobFiles(array $links, string $htmlString)

Delete unused blob files

Parameters

array $links
string $htmlString

in Document at line 655
static deleteUnusedBlockElementsImages(array $mediaLinks, string $htmlString)

Parameters

array $mediaLinks
string $htmlString

in Document at line 701
static removeOldFiles(string $uploadDir, string $format = 'Y-m-d-h')

Remove old files

Parameters

string $uploadDir
string $format

in Document at line 721
protected string createFolder()

A method that creates the appropriate day folder for every image uploaded

Return Value

string

in Document at line 750
protected string createProFolder()

Create project folder if it does not exist

Return Value

string

at line 185
__construct()

Image constructor.

at line 193
Product|null getProduct()

Return Value

Product|null

at line 203
Image setProduct(Product|null $product)

Parameters

Product|null $product

Return Value

Image

at line 213
Brand|null getBrand()

Return Value

Brand|null

at line 223
Image setBrand(Brand|null $brand)

Parameters

Brand|null $brand

Return Value

Image

at line 233
ProductAttributeValues|null getProductAttributeValue()

Return Value

ProductAttributeValues|null

at line 243
Image setProductAttributeValue(ProductAttributeValues|null $productAttributeValue)

Parameters

ProductAttributeValues|null $productAttributeValue

Return Value

Image

at line 253
Category|null getCategory()

Return Value

Category|null

at line 263
Image setCategory(Category|null $category)

Parameters

Category|null $category

Return Value

Image

at line 273
Category|null getCategoryGallery()

Return Value

Category|null

at line 283
Image setCategoryGallery(Category|null $categoryGallery)

Parameters

Category|null $categoryGallery

Return Value

Image

at line 295
Image setId(int $id)

Parameters

int $id

Return Value

Image

at line 305
integer getId()

Return Value

integer

at line 315
Image setPosition(string $position)

Parameters

string $position

Return Value

Image

at line 327
string getPosition()

Get position

Return Value

string

at line 335
string getBase64Content()

Return Value

string

at line 345
Image setBase64Content(string $base64Content)

Parameters

string $base64Content

Return Value

Image

at line 355
bool isWatermarkImage()

Return Value

bool

at line 365
Image setWatermarkImage(bool $watermarkImage)

Parameters

bool $watermarkImage

Return Value

Image

at line 375
int getPriority()

Return Value

int

at line 385
Image setPriority(int $priority)

Parameters

int $priority

Return Value

Image

at line 400
string serialize()

(PHP 5 >= 5.1.0)
String representation of object

Return Value

string the string representation of the object or null

at line 423
void unserialize(string $serialized)

(PHP 5 >= 5.1.0)
Constructs the object

Parameters

string $serialized The string representation of the object.

Return Value

void

at line 435
mixed getThumbnails()

Return Value

mixed

at line 445
Image setThumbnails(ArrayCollection $thumbnails)

Parameters

ArrayCollection $thumbnails

Return Value

Image

at line 457
Image addThumbnail(Thumbnail $thumbnail)

Parameters

Thumbnail $thumbnail

Return Value

Image

at line 468
removeThumbnail(Thumbnail $thumbnail)

Parameters

Thumbnail $thumbnail

at line 477
createThumbnails()

Create thumbnails

at line 503
bool isNotResizable()

Return Value

bool

at line 513
Image setNotResizable(bool $notResizable)

Parameters

bool $notResizable

Return Value

Image

at line 523
deleteAllThumbnailsFromFile()

at line 536
string getFilePath()

Return Value

string

at line 546
Image setFilePath(string $filePath)

Parameters

string $filePath

Return Value

Image

at line 556
string getCode()

Return Value

string

at line 566
Image setCode(string $code)

Parameters

string $code

Return Value

Image