src/Entity/Invitation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Constant\BandMemberRoleConstant;
  6. use App\Constant\InvitationStatusConstant;
  7. /**
  8.  * @ORM\Entity
  9.  */
  10. class Invitation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @var string $email
  20.      * @ORM\Column(name="email", type="string", nullable=true)
  21.      */
  22.     private $email;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="Band", inversedBy="invitations")
  25.      * @ORM\JoinColumn(name="band_id", referencedColumnName="id")
  26.      */
  27.     private $band;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="role", type="string", length=255)
  32.      */
  33.     private $role BandMemberRoleConstant::MEMBER;
  34.     /**
  35.      * @var string $status
  36.      *
  37.      * @ORM\Column(name="status", type="string", length=255)
  38.      */
  39.     private $status InvitationStatusConstant::WAITING;
  40.     /**
  41.      * @var DateTime $createdAt
  42.      *
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $createdAt;
  46.     /**
  47.      * @var User $createdBy
  48.      *
  49.      * @ORM\ManyToOne(targetEntity="User")
  50.      * @ORM\JoinColumn(name="createdBy", referencedColumnName="id")
  51.      */
  52.     private $createdBy;
  53.     /**
  54.      * @var DateTime $validatedAt
  55.      * @ORM\Column(name="validated_at", type="datetime", nullable=true)
  56.      */
  57.     private $validatedAt;
  58.     /**
  59.      * Get id
  60.      *
  61.      * @return integer
  62.      */
  63.     public function getId(): int
  64.     {
  65.         return $this->id;
  66.     }
  67.     /**
  68.      * Set email
  69.      *
  70.      * @param string $email
  71.      *
  72.      * @return Invitation
  73.      */
  74.     public function setEmail(string $email): Invitation
  75.     {
  76.         $this->email $email;
  77.         return $this;
  78.     }
  79.     /**
  80.      * Get email
  81.      *
  82.      * @return string|null
  83.      */
  84.     public function getEmail(): ?string
  85.     {
  86.         return $this->email;
  87.     }
  88.     /**
  89.      * Set role
  90.      *
  91.      * @param string $role
  92.      *
  93.      * @return Invitation
  94.      */
  95.     public function setRole(string $role): Invitation
  96.     {
  97.         $this->role $role;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get role
  102.      *
  103.      * @return string
  104.      */
  105.     public function getRole(): string
  106.     {
  107.         return $this->role;
  108.     }
  109.     /**
  110.      * Set status
  111.      *
  112.      * @param string $status
  113.      *
  114.      * @return Invitation
  115.      */
  116.     public function setStatus(string $status): Invitation
  117.     {
  118.         $this->status $status;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get status
  123.      *
  124.      * @return string
  125.      */
  126.     public function getStatus(): string
  127.     {
  128.         return $this->status;
  129.     }
  130.     /**
  131.      * Set createdAt
  132.      *
  133.      * @param DateTime $createdAt
  134.      *
  135.      * @return Invitation
  136.      */
  137.     public function setCreatedAt(DateTime $createdAt): Invitation
  138.     {
  139.         $this->createdAt $createdAt;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get createdAt
  144.      *
  145.      * @return DateTime
  146.      */
  147.     public function getCreatedAt(): DateTime
  148.     {
  149.         return $this->createdAt;
  150.     }
  151.     /**
  152.      * Set validatedAt
  153.      *
  154.      * @param DateTime $validatedAt
  155.      *
  156.      * @return Invitation
  157.      */
  158.     public function setValidatedAt(DateTime $validatedAt): Invitation
  159.     {
  160.         $this->validatedAt $validatedAt;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get validatedAt
  165.      *
  166.      * @return DateTime
  167.      */
  168.     public function getValidatedAt(): DateTime
  169.     {
  170.         return $this->validatedAt;
  171.     }
  172.     /**
  173.      * Set band
  174.      *
  175.      * @param Band|null $band
  176.      *
  177.      * @return Invitation
  178.      */
  179.     public function setBand(Band $band null): Invitation
  180.     {
  181.         $this->band $band;
  182.         return $this;
  183.     }
  184.     /**
  185.      * Get band
  186.      *
  187.      * @return Band|null
  188.      */
  189.     public function getBand(): ?Band
  190.     {
  191.         return $this->band;
  192.     }
  193.     /**
  194.      * Set createdBy
  195.      *
  196.      * @param User|null $createdBy
  197.      *
  198.      * @return Invitation
  199.      */
  200.     public function setCreatedBy(User $createdBy null): Invitation
  201.     {
  202.         $this->createdBy $createdBy;
  203.         return $this;
  204.     }
  205.     /**
  206.      * Get createdBy
  207.      *
  208.      * @return User|null
  209.      */
  210.     public function getCreatedBy(): ?User
  211.     {
  212.         return $this->createdBy;
  213.     }
  214. }