src/GamificationBundle/Entity/VisitorBonus.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\GamificationBundle\Entity;
  3. use App\CasinoBundle\Entity\NewBonus;
  4. use App\CmsBundle\Entity\TimeStampedTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Table(
  8.  *     name="visitor_bonus",
  9.  *     uniqueConstraints={@ORM\UniqueConstraint(name="unique_visitor_bonus", columns={"visitor_id", "bonus_id"})}
  10.  * )
  11.  *
  12.  * @ORM\Entity(repositoryClass="App\GamificationBundle\Repository\VisitorBonusRepository")
  13.  */
  14. class VisitorBonus
  15. {
  16.     use TimeStampedTrait;
  17.     /**
  18.      * @ORM\Column(name="id", type="bigint", nullable=false)
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="IDENTITY")
  21.      */
  22.     private int $id;
  23.     /**
  24.      * @ORM\Column(name="is_mystery", type="boolean", nullable=false, options={"default"=false})
  25.      */
  26.     private bool $isMystery false;
  27.     /**
  28.      * @ORM\ManyToOne(
  29.      *     targetEntity="App\GamificationBundle\Entity\Visitor",
  30.      *     inversedBy="ownedBonuses"
  31.      * )
  32.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  33.      */
  34.     private ?Visitor $visitor null;
  35.     /**
  36.      * @ORM\ManyToOne(
  37.      *     targetEntity="App\CasinoBundle\Entity\NewBonus",
  38.      *     inversedBy="bonusOwnersVisitors"
  39.      * )
  40.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  41.      */
  42.     private ?NewBonus $bonus null;
  43.     /**
  44.      * @return bool
  45.      */
  46.     public function isMystery(): bool
  47.     {
  48.         return $this->isMystery;
  49.     }
  50.     /**
  51.      * @param bool $isMystery
  52.      * @return $this
  53.      */
  54.     public function setIsMystery(bool $isMystery): self
  55.     {
  56.         $this->isMystery $isMystery;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return ?Visitor
  61.      */
  62.     public function getVisitor(): ?Visitor
  63.     {
  64.         return $this->visitor;
  65.     }
  66.     /**
  67.      * @param ?Visitor $visitor
  68.      * @return $this
  69.      */
  70.     public function setVisitor(?Visitor $visitor): self
  71.     {
  72.         $this->visitor $visitor;
  73.         return $this;
  74.     }
  75.     /**
  76.      * @return ?NewBonus
  77.      */
  78.     public function getBonus(): ?NewBonus
  79.     {
  80.         return $this->bonus;
  81.     }
  82.     /**
  83.      * @param ?NewBonus $bonus
  84.      * @return $this
  85.      */
  86.     public function setBonus(?NewBonus $bonus): self
  87.     {
  88.         $this->bonus $bonus;
  89.         return $this;
  90.     }
  91. }