src/Entity/PollResponse.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\PollResponseRepository")
  8.  */
  9. class PollResponse
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="bigint")
  15.      */
  16.     private $id;
  17.     
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\PollOption", inversedBy="pollResponses")
  20.      * @ORM\JoinColumn(name="poll_option_id", referencedColumnName="id", onDelete="SET NULL")
  21.      */
  22.     private $pollOption;
  23.     
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="pollResponses")
  26.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
  27.      */
  28.     private $user;
  29.     
  30.     
  31.     public function __construct ()
  32.     {
  33.         
  34.     }
  35.     public function getId()
  36.     {
  37.         return $this->id;
  38.     }
  39.     
  40.     public function getPollOption(): ?PollOption
  41.     {
  42.         return $this->pollOption;
  43.     }
  44.     
  45.     public function setPollOption(?PollOption $pollOption null): self
  46.     {
  47.         $this->pollOption $pollOption;
  48.         return $this;
  49.     }
  50.     
  51.     public function getUser(): ?User
  52.     {
  53.         return $this->user;
  54.     }
  55.     
  56.     public function setUser(?User $user null): self
  57.     {
  58.         $this->user $user;
  59.         return $this;
  60.     }
  61.     
  62.     public function __toString ()
  63.     {
  64.         return "Poll Response: " $this->id;
  65.     }
  66.     
  67. }