ManufacturerWriteService
in package
implements
ManufacturerWriteServiceInterface
Class ManufacturerWriteService
Tags
Interfaces, Classes and Traits
- ManufacturerWriteServiceInterface
- Interface ManufacturerWriteServiceInterface
Table of Contents
- $repository : ManufacturerRepositoryInterface
- $storage : ImageFileStorage
- __construct() : mixed
- createManufacturer() : Manufacturer
- Creates manufacturer entity.
- delete() : $this|ManufacturerWriteServiceInterface
- Deletes manufacturer entity from database.
- deleteImage() : $this
- Delete an existing image from filesystem.
- save() : $this|ManufacturerWriteServiceInterface
- Saves manufacturer entity in database.
- saveImage() : $this
- Saves an existing image file with giving name.
- unifyFilename() : FilenameStringType
- If the file is existing ,the filename get an unique id as prefix
Properties
$repository
protected
ManufacturerRepositoryInterface
$repository
$storage
protected
ImageFileStorage
$storage
Methods
__construct()
public
__construct(ManufacturerRepositoryInterface $repository, ImageFileStorage $storage) : mixed
Parameters
- $repository : ManufacturerRepositoryInterface
- $storage : ImageFileStorage
Return values
mixed —createManufacturer()
Creates manufacturer entity.
public
createManufacturer() : Manufacturer
Return values
Manufacturer —New manufacturer entity.
delete()
Deletes manufacturer entity from database.
public
delete(ManufacturerInterface $manufacturer) : $this|ManufacturerWriteServiceInterface
Parameters
- $manufacturer : ManufacturerInterface
-
Manufacturer unit to be deleted.
Return values
$this|ManufacturerWriteServiceInterface —Same instance for chained method calls.
deleteImage()
Delete an existing image from filesystem.
public
deleteImage(IdType $id) : $this
Parameters
- $id : IdType
-
manufacturer id to get the image name.
Return values
$this —save()
Saves manufacturer entity in database.
public
save(ManufacturerInterface $manufacturer) : $this|ManufacturerWriteServiceInterface
Parameters
- $manufacturer : ManufacturerInterface
-
Manufacturer unit to be saved.
Return values
$this|ManufacturerWriteServiceInterface —Same instance for chained method calls.
saveImage()
Saves an existing image file with giving name.
public
saveImage(ExistingFile $sourceFile, FilenameStringType $preferredFilename) : $this
Parameters
- $sourceFile : ExistingFile
-
existing file to save.
- $preferredFilename : FilenameStringType
-
filename to saving file.
Return values
$this —|\ManufacturerWriteServiceInterface Same instance for chained method calls.
unifyFilename()
If the file is existing ,the filename get an unique id as prefix
public
unifyFilename(FilenameStringType $preferredFilename) : FilenameStringType
Parameters
- $preferredFilename : FilenameStringType
-
filename of uploaded file.
Return values
FilenameStringType —filename with or without unique id.