src/CasinoBundle/Entity/BonusTag.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\CasinoBundle\Entity;
  3. use App\CmsBundle\Entity\Tag;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\CasinoBundle\Repository\BonusTagRepository")
  7.  * @ORM\Table(name="bonus_tag",
  8.  *     indexes={
  9.  *         @ORM\Index(name="bonus_idx", columns={"new_bonus_id"}),
  10.  *         @ORM\Index(name="bonus_tag_idx", columns={"tag_id"})
  11.  *     },
  12.  *     uniqueConstraints={
  13.  *         @ORM\UniqueConstraint(name="bonus_tag_unique", columns={"new_bonus_id", "tag_id"})
  14.  *     }
  15.  * )
  16.  */
  17. class BonusTag
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\ManyToOne(targetEntity=NewBonus::class)
  22.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  23.      */
  24.     private NewBonus $newBonus;
  25.     /**
  26.      * @ORM\Id
  27.      * @ORM\ManyToOne(targetEntity=Tag::class)
  28.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  29.      */
  30.     private Tag $tag;
  31.     /**
  32.      * @ORM\Column(type="float")
  33.      */
  34.     private ?float $weight;
  35.     /**
  36.      * @return NewBonus
  37.      */
  38.     public function getNewBonus(): NewBonus
  39.     {
  40.         return $this->newBonus;
  41.     }
  42.     /**
  43.      * @param NewBonus $newBonus
  44.      * @return $this
  45.      */
  46.     public function setNewBonus(NewBonus $newBonus): self
  47.     {
  48.         $this->newBonus $newBonus;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Tag
  53.      */
  54.     public function getTag(): Tag
  55.     {
  56.         return $this->tag;
  57.     }
  58.     /**
  59.      * @param Tag $tag
  60.      * @return $this
  61.      */
  62.     public function setTag(Tag $tag): self
  63.     {
  64.         $this->tag $tag;
  65.         return $this;
  66.     }
  67.     /**
  68.      * @return float|null
  69.      */
  70.     public function getWeight(): ?float
  71.     {
  72.         return $this->weight;
  73.     }
  74.     /**
  75.      * @param float $weight
  76.      * @return $this
  77.      */
  78.     public function setWeight(float $weight): self
  79.     {
  80.         $this->weight $weight;
  81.         return $this;
  82.     }
  83. }