Created
February 15, 2017 15:45
-
-
Save lbarulski/c8b71a076bd075b6d4f268df18cc6e0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Answer | |
* | |
* @ORM\Table(name="answer") | |
*/ | |
class Answer | |
{ | |
/** | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
*/ | |
private $id; | |
/** | |
* @ORM\Column(name="content", type="string", nullable=false) | |
*/ | |
private $content; | |
/** | |
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Question", inversedBy="answer") | |
* @ORM\JoinColumns({ | |
* @ORM\JoinColumn(name="question_id", referencedColumnName="id", unique=true) | |
* }) | |
*/ | |
private $question; | |
/** | |
* Get id | |
* | |
* @return string | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* Set content | |
* | |
* @param string $content | |
* | |
* @return Answer | |
*/ | |
public function setContent($content) | |
{ | |
$this->content = $content; | |
return $this; | |
} | |
/** | |
* Get content | |
* | |
* @return string | |
*/ | |
public function getContent() | |
{ | |
return $this->content; | |
} | |
/** | |
* Set question | |
* | |
* @param Question $question | |
* | |
* @return Answer | |
*/ | |
public function setQuestion(Question $question = null) | |
{ | |
$this->question = $question; | |
return $this; | |
} | |
/** | |
* Get question | |
* | |
* @return Question | |
*/ | |
public function getQuestion() | |
{ | |
return $this->question; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Table(name="question") | |
*/ | |
class Question | |
{ | |
/** | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
*/ | |
private $id; | |
/** | |
* @ORM\Column(name="content", type="string", nullable=true) | |
*/ | |
private $content; | |
/** | |
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Answer", mappedBy="question") | |
*/ | |
private $answer; | |
/** | |
* Set content | |
* | |
* @param string $content | |
* | |
* @return Question | |
*/ | |
public function setContent($content) | |
{ | |
$this->content = $content; | |
return $this; | |
} | |
/** | |
* Get content | |
* | |
* @return string | |
*/ | |
public function getContent() | |
{ | |
return $this->content; | |
} | |
/** | |
* Get id | |
* | |
* @return string | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* Set answer | |
* | |
* @param Answer $answer | |
* | |
* @return Question | |
*/ | |
public function setAnswer(Answer $answer = null) | |
{ | |
$this->answer = $answer; | |
return $this; | |
} | |
/** | |
* Get answer | |
* | |
* @return Answer | |
*/ | |
public function getAnswer() | |
{ | |
return $this->answer; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment