src/Entity/SpeakerCharity.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SpeakerCharityRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=SpeakerCharityRepository::class)
  7.  */
  8. class SpeakerCharity
  9. {
  10.     const TYPE_FIX 0;
  11.     const TYPE_PERCENT 1;
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Charity::class)
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $charity;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Speaker::class, inversedBy="charities")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $speaker;
  28.     /**
  29.      * @ORM\Column(type="integer", nullable=true)
  30.      */
  31.     private $amount 0;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $type self::TYPE_FIX;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getCharity(): ?Charity
  41.     {
  42.         return $this->charity;
  43.     }
  44.     public function setCharity(?Charity $charity): self
  45.     {
  46.         $this->charity $charity;
  47.         return $this;
  48.     }
  49.     public function getSpeaker(): ?Speaker
  50.     {
  51.         return $this->speaker;
  52.     }
  53.     public function setSpeaker(?Speaker $speaker): self
  54.     {
  55.         $this->speaker $speaker;
  56.         return $this;
  57.     }
  58.     public function getAmount(): ?int
  59.     {
  60.         return $this->amount;
  61.     }
  62.     public function setAmount(?int $amount): self
  63.     {
  64.         $this->amount $amount;
  65.         return $this;
  66.     }
  67.     public function getType(): ?int
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(?int $type): self
  72.     {
  73.         $this->type = (is_null($type)) ? self::TYPE_FIX $type;
  74.         return $this;
  75.     }
  76. }