<?php
declare(strict_types=1);
namespace Slivki\Dto\Tire;
use JsonSerializable;
final class TireDto implements JsonSerializable
{
private int $id;
private string $name;
private ?string $image;
private ?float $regularPrice;
private ?float $offerPrice;
private ?float $discount;
public function __construct(
int $id,
string $name,
?string $image,
?float $regularPrice,
?float $offerPrice,
?float $discount
) {
$this->id = $id;
$this->name = $name;
$this->image = $image;
$this->regularPrice = $regularPrice;
$this->offerPrice = $offerPrice;
$this->discount = $discount;
}
public function getId(): int
{
return $this->id;
}
public function getName(): string
{
return $this->name;
}
public function getImage(): ?string
{
return $this->image;
}
public function getRegularPrice(): ?float
{
return $this->regularPrice;
}
public function getOfferPrice(): ?float
{
return $this->offerPrice;
}
public function getDiscount(): ?float
{
return $this->discount;
}
public function jsonSerialize(): array
{
return [
'id' => $this->id,
'name' => $this->name,
'image' => $this->image,
'regularPrice' => $this->regularPrice,
'offerPrice' => $this->offerPrice,
'discount' => $this->discount,
];
}
}