<?phpdeclare(strict_types=1);namespace App\Shop\Doctrine\Entity;use App\Shop\Doctrine\Repository\PriceRepository;use DateTimeImmutable;use Doctrine\ORM\Mapping\Column;use Doctrine\ORM\Mapping\Entity;use Doctrine\ORM\Mapping\GeneratedValue;use Doctrine\ORM\Mapping\Id;use Doctrine\ORM\Mapping\JoinColumn;use Doctrine\ORM\Mapping\ManyToOne;use Doctrine\ORM\Mapping\Table;use Symfony\Component\PropertyAccess\PropertyAccess;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints\NotBlank;#[Entity(repositoryClass: PriceRepository::class)]#[Table(name: '`shop_price`')]class Price{ #[Id] #[Column(type: 'integer')] #[GeneratedValue] #[Groups(['product'])] private ?int $id = null; #[Column(type: 'datetime_immutable')] private DateTimeImmutable $createdAt; #[ManyToOne(targetEntity: Product::class, inversedBy: 'pricingHistory')] #[JoinColumn(nullable: false, onDelete: 'CASCADE')] private Product $product; #[ManyToOne(targetEntity: Vat::class)] #[JoinColumn(nullable: false)] private Vat $vat; #[Column(type: 'integer')] #[NotBlank] private int $purchasePrice; #[Column(type: 'integer')] #[NotBlank] private int $retailPrice; #[Column(type: 'integer', options: ['default' => 0])] #[NotBlank] private int $shippingCosts; #[Column(type: 'integer')] #[NotBlank] private int $ecoTax; #[Column(type: 'integer')] #[NotBlank] private int $extraCost = 0; #[Column(type: 'integer', nullable: true, options: ['default' => null])] private ?int $ppgc = null; public function __construct() { $this->createdAt = new DateTimeImmutable(); } public function __get(string $name): mixed { $propertyAccessor = PropertyAccess::createPropertyAccessor(); return $propertyAccessor->getValue($this, $name); } public function getId(): ?int { return $this->id; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function getProduct(): Product { return $this->product; } public function setProduct(Product $product): void { $this->product = $product; } public function getPurchasePrice(): int { return $this->purchasePrice; } public function setPurchasePrice(int $purchasePrice): void { $this->purchasePrice = $purchasePrice; } public function getVat(): Vat { return $this->vat; } public function setVat(Vat $vat): void { $this->vat = $vat; } public function getRetailPrice(): int { return $this->retailPrice; } public function setRetailPrice(int $retailPrice): void { $this->retailPrice = $retailPrice; } public function getShippingCosts(): int { return $this->shippingCosts; } public function setShippingCosts(int $shippingCosts): void { $this->shippingCosts = $shippingCosts; } public function getEcoTax(): int { return $this->ecoTax; } public function setEcoTax(int $ecoTax): void { $this->ecoTax = $ecoTax; } public function getExtraCost(): int { return $this->extraCost; } public function setExtraCost(int $extraCost): void { $this->extraCost = $extraCost; } public function getPpgc(): ?int { return $this->ppgc; } public function setPpgc(int $ppgc): void { $this->ppgc = $ppgc; }}