for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* another great project.
* You can find more information about us on https://bitbag.shop and write us
* an email on [email protected].
*/
declare(strict_types=1);
namespace BitBag\SyliusElasticsearchPlugin\Controller\Response\DTO;
final class Item
{
/** @var string */
private $taxonName;
private $name;
private $description;
private $slug;
private $price;
private $image;
public function __construct(
string $taxonName,
string $name,
?string $description,
string $slug,
string $price,
?string $image
) {
$this->taxonName = $taxonName;
$this->name = $name;
$this->description = $description;
$this->slug = $slug;
$this->price = $price;
$this->image = $image;
}
public function taxonName(): string
return $this->taxonName;
public function name(): string
return $this->name;
public function description(): ?string
return $this->description;
public function slug(): string
return $this->slug;
public function price(): string
return $this->price;
public function image(): ?string
return $this->image;
public function toArray(): array
return [
'taxon_name' => $this->taxonName(),
'name' => $this->name(),
'description' => $this->description() ?: '',
'slug' => $this->slug(),
'price' => $this->price(),
'image' => $this->image() ?: '',
];