src/CasinoBundle/Entity/UserBonus.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\CasinoBundle\Entity;
  3. use App\CmsBundle\Entity\TimeStampedTrait;
  4. use App\ProfileBundle\Entity\User;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Table(
  8.  *     name="user_bonus",
  9.  *     uniqueConstraints={@ORM\UniqueConstraint(name="unique_user_bonus", columns={"user_id", "bonus_id"})}
  10.  * )
  11.  *
  12.  * @ORM\Entity(repositoryClass="App\CasinoBundle\Repository\UserBonusRepository")
  13.  */
  14. class UserBonus
  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\ManyToOne(
  25.      *     targetEntity="App\ProfileBundle\Entity\User",
  26.      *     inversedBy="ownedBonuses"
  27.      * )
  28.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  29.      */
  30.     private ?User $user null;
  31.     /**
  32.      * @ORM\ManyToOne(
  33.      *     targetEntity="App\CasinoBundle\Entity\NewBonus",
  34.      *     inversedBy="bonusOwners"
  35.      * )
  36.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  37.      */
  38.     private ?NewBonus $bonus null;
  39.     /**
  40.      * @ORM\Column(name="is_mystery", type="boolean", nullable=false, options={"default"=false})
  41.      */
  42.     private bool $isMystery false;
  43.     /**
  44.      * @return ?User
  45.      */
  46.     public function getUser(): ?User
  47.     {
  48.         return $this->user;
  49.     }
  50.     /**
  51.      * @param ?User $user
  52.      * @return $this
  53.      */
  54.     public function setUser(?User $user): self
  55.     {
  56.         $this->user $user;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return ?NewBonus
  61.      */
  62.     public function getBonus(): ?NewBonus
  63.     {
  64.         return $this->bonus;
  65.     }
  66.     /**
  67.      * @param ?NewBonus $bonus
  68.      * @return $this
  69.      */
  70.     public function setBonus(?NewBonus $bonus): self
  71.     {
  72.         $this->bonus $bonus;
  73.         return $this;
  74.     }
  75. }