src/Entity/Addon/EshopToken.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Addon;
  3. use App\Entity\Addon\Trait\TokenTrait;
  4. use App\Entity\BaseEntity;
  5. use App\Repository\Addon\EshopTokenRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassEshopTokenRepository::class)]
  8. class EshopToken extends BaseEntity
  9. {
  10.     use TokenTrait;
  11.     #[ORM\OneToOne(mappedBy'eshopToken'targetEntityInstallation::class)]
  12.     private ?Installation $installation null;
  13.     public function getInstallation(): ?Installation
  14.     {
  15.         return $this->installation;
  16.     }
  17.     public function setInstallation(?Installation $installation): self
  18.     {
  19.         // unset the owning side of the relation if necessary
  20.         if ($installation === null && $this->installation !== null) {
  21.             $this->installation->setEshopToken(null);
  22.         }
  23.         // set the owning side of the relation if necessary
  24.         if ($installation !== null && $installation->getEshopToken() !== $this) {
  25.             $installation->setEshopToken($this);
  26.         }
  27.         $this->installation $installation;
  28.         return $this;
  29.     }
  30. }