ImageListWriter
in package
Class ImageListWriter
Table of Contents
- $connection : Connection
- $imagesDirectory : OriginalImagesDirectory
- $languageCodeToIdMap : array<string|int, mixed>
- __construct() : mixed
- ImageListReader constructor.
- createImageList() : int
- Creates an empty image list.
- createMultipleImageLists() : array<string|int, int>
- Creates multiple empty image list.
- deleteImageLists() : void
- Deletes one or more existing image lists.
- storeImageLists() : void
- Stores one or more existing image lists.
- addImages() : void
- deleteImageFromFilesystem() : void
- Removes an image from the filesystem
- getImageIdByRelativePathAndListId() : int
- getLanguageIdFromLanguageCode() : int
- imageIsNotUsedInProductsOrLists() : string|null
- Determines if an image is not used in another product or list
- removeImages() : array<string|int, mixed>
- updateImageListName() : void
- updateImages() : void
Properties
$connection
private
Connection
$connection
$imagesDirectory
private
OriginalImagesDirectory
$imagesDirectory
$languageCodeToIdMap
private
array<string|int, mixed>
$languageCodeToIdMap
= []
Methods
__construct()
ImageListReader constructor.
public
__construct(Connection $connection, OriginalImagesDirectory $imagesDirectory) : mixed
Parameters
- $connection : Connection
- $imagesDirectory : OriginalImagesDirectory
Return values
mixed —createImageList()
Creates an empty image list.
public
createImageList(ImageListName $imageListName) : int
Parameters
- $imageListName : ImageListName
Tags
Return values
int —createMultipleImageLists()
Creates multiple empty image list.
public
createMultipleImageLists(ImageListName ...$imageListNames) : array<string|int, int>
Parameters
- $imageListNames : ImageListName
Tags
Return values
array<string|int, int> —deleteImageLists()
Deletes one or more existing image lists.
public
deleteImageLists(ImageListId ...$imageListIds) : void
Parameters
- $imageListIds : ImageListId
Tags
Return values
void —storeImageLists()
Stores one or more existing image lists.
public
storeImageLists(ImageList ...$imageLists) : void
Parameters
- $imageLists : ImageList
Tags
Return values
void —addImages()
private
addImages(ImageList $imageList) : void
Parameters
- $imageList : ImageList
Return values
void —deleteImageFromFilesystem()
Removes an image from the filesystem
private
deleteImageFromFilesystem(string $absolutePath) : void
Parameters
- $absolutePath : string
Return values
void —getImageIdByRelativePathAndListId()
private
getImageIdByRelativePathAndListId(int $id, Image $removedImage) : int
Parameters
- $id : int
- $removedImage : Image
Tags
Return values
int —getLanguageIdFromLanguageCode()
private
getLanguageIdFromLanguageCode(string $code) : int
Parameters
- $code : string
Return values
int —imageIsNotUsedInProductsOrLists()
Determines if an image is not used in another product or list
private
imageIsNotUsedInProductsOrLists(string $relativePath) : string|null
Parameters
- $relativePath : string
Return values
string|null —returns relativePath if it is no longer used and null if it is
removeImages()
private
removeImages(ImageList $imageList) : array<string|int, mixed>
Parameters
- $imageList : ImageList
Return values
array<string|int, mixed> —updateImageListName()
private
updateImageListName(ImageList $imageList) : void
Parameters
- $imageList : ImageList
Return values
void —updateImages()
private
updateImages(ImageList $imageList) : void
Parameters
- $imageList : ImageList