<?php
namespace App\Entity\Addon;
use App\Entity\Addon\Trait\TokenTrait;
use App\Entity\BaseEntity;
use App\Repository\Addon\EshopTokenRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EshopTokenRepository::class)]
class EshopToken extends BaseEntity
{
use TokenTrait;
#[ORM\OneToOne(mappedBy: 'eshopToken', targetEntity: Installation::class)]
private ?Installation $installation = null;
public function getInstallation(): ?Installation
{
return $this->installation;
}
public function setInstallation(?Installation $installation): self
{
// unset the owning side of the relation if necessary
if ($installation === null && $this->installation !== null) {
$this->installation->setEshopToken(null);
}
// set the owning side of the relation if necessary
if ($installation !== null && $installation->getEshopToken() !== $this) {
$installation->setEshopToken($this);
}
$this->installation = $installation;
return $this;
}
}