for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use AppBundle\Entity\Vote;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Choice
*
* @ORM\Table(name="choices")
* @ORM\Entity(repositoryClass="AppBundle\Repository\ChoiceRepository")
*/
class Choice
{
* @var int
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
private $id;
* @var string
* @ORM\Column(name="choice_name", type="string", length=255)
private $choiceName;
* @ORM\OneToMany(targetEntity="Vote", mappedBy="choice")
private $votes;
* Constructor
public function __construct()
$this->votes = new ArrayCollection();
}
* Get id
* @return integer
public function getId(): int
return $this->id;
* Set choiceName
* @param string $choiceName
* @return Choice
public function setChoiceName(string $choiceName)
$this->choiceName = $choiceName;
return $this;
* Get choiceName
* @return string
public function getChoiceName(): string
return $this->choiceName;
* Add vote
* @param \AppBundle\Entity\Vote $vote
public function addVote(Vote $vote)
$this->votes[] = $vote;
* Remove vote
public function removeVote(Vote $vote)
$this->votes->removeElement($vote);
* Get votes
* @return \Doctrine\Common\Collections\Collection
public function getVotes()
return $this->votes;