date-poll-api/src/Entity/Vote.php

120 lines
2.3 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity(repositoryClass="App\Repository\VoteRepository")
*/
class Vote {
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
* @Serializer\Type("integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Type("string")
*/
public $pseudo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Type("string")
*/
public $answerTxt;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Serializer\Type("datetime")
*/
private $answerDate;
/**
* @ORM\Column(type="datetime")
* @Serializer\Type("datetime")
*/
public $creationDate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Poll", inversedBy="votes")
* @ORM\JoinColumn(nullable=false)
* @Serializer\Type("App\Entity\Poll")
*/
private $poll;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Choice", inversedBy="votes")
* @ORM\JoinColumn(nullable=false)
* @Serializer\Type("App\Entity\choice")
*/
public $choice;
public function getId(): ?int {
return $this->id;
}
public function getAnswerTxt(): ?string {
return $this->answerTxt;
}
public function setAnswerTxt( ?string $answerTxt ): self {
$this->answerTxt = $answerTxt;
return $this;
}
public function getAnswerDate(): ?\DateTimeInterface {
return $this->answerDate;
}
public function setAnswerDate( ?\DateTimeInterface $answerDate ): self {
$this->answerDate = $answerDate;
return $this;
}
public function getCreationDate(): ?\DateTimeInterface {
return $this->creationDate;
}
public function setCreationDate( \DateTimeInterface $creationDate ): self {
$this->creationDate = $creationDate;
return $this;
}
public function getPoll(): ?Poll {
return $this->poll;
}
public function setPoll( ?Poll $poll ): self {
$this->poll = $poll;
return $this;
}
public function getPseudo(): ?string {
return $this->pseudo;
}
public function setPseudo( ?string $pseudo ): self {
$this->pseudo = $pseudo;
return $this;
}
public function getChoice(): ?Choice {
return $this->choice;
}
public function setChoice( ?Choice $choice ): self {
$this->choice = $choice;
return $this;
}
}