<?php
namespace App\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* Choice
*
* @ORM\Table(name="choice")
* @ORM\Entity(repositoryClass="Gedmo\Sortable\Entity\Repository\SortableRepository")
*/
class Choice
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="Question", inversedBy="choices" , cascade={"persist"})
* @ORM\JoinColumn(name="question_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $question;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @var integer
* @Gedmo\SortablePosition
* @ORM\Column(name="position", type="integer")
*/
private $position;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set question
*
* @param integer $question
*
* @return Choice
*/
public function setQuestion($question)
{
$this->question = $question;
return $this;
}
/**
* Get question
*
* @return int
*/
public function getQuestion()
{
return $this->question;
}
/**
* Set name
*
* @param string $name
*
* @return Choice
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set position
*
* @param integer $position
*
* @return Choice
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* Get position
*
* @return int
*/
public function getPosition()
{
return $this->position;
}
public function addQuestion(\App\Entity\Question $question)
{
$this->question = $question;
}
}