Created
May 21, 2014 01:24
-
-
Save kfuchs/08faaebdeffe654e7765 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Dvd | |
* | |
* @ORM\Table(name="dvd") | |
* @ORM\Entity | |
*/ | |
class Dvd | |
{ | |
/** | |
* @var integer | |
* | |
* @ORM\Column(name="id", type="integer", nullable=false) | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="IDENTITY") | |
* @ORM\OneToOne(targetEntity="DvdDescription", mappedBy="dvd") | |
*/ | |
private $id; | |
/** | |
* | |
* @Assert\Valid | |
* @Assert\NotBlank() | |
* @ORM\OneToOne(targetEntity="DvdDescription", mappedBy="dvd", cascade={"persist", "remove"}) | |
*/ | |
private $dvdDescription; | |
/** | |
* @return \Doctrine\Common\Collections\ArrayCollection|DvdDescription | |
*/ | |
public function getDvdDescription() | |
{ | |
return $this->dvdDescription; | |
} | |
/** | |
* Set Dvd Info | |
* | |
* @param DvdDescription $dvdDescription | |
* @return $this | |
*/ | |
public function setDvdDescription(DvdDescription $dvdDescription) | |
{ | |
$dvdDescription->setDvd($this); | |
$this->dvdDescription = $dvdDescription; | |
return $this; | |
} |
This file contains hidden or 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
/** | |
* DvdDescription | |
* | |
* @ORM\Table(name="dvd_description") | |
* @ORM\Entity | |
*/ | |
class DvdDescription | |
{ | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="title", type="string", length=200, nullable=false) | |
*/ | |
private $title; | |
/** | |
* @var string | |
* | |
* @ORM\Column(name="description", type="text", nullable=false) | |
*/ | |
private $description; | |
/** | |
* @var \Dvd | |
* | |
* @ORM\Id | |
* @ORM\OneToOne(targetEntity="Dvd", inversedBy="id") | |
* @ORM\JoinColumns({ | |
* @ORM\JoinColumn(name="dvd_id", referencedColumnName="id") | |
* }) | |
*/ | |
private $dvd; | |
/** | |
* Set title | |
* | |
* @param string $title | |
* @return DvdDescription | |
*/ | |
public function setTitle($title) | |
{ | |
$this->title = $title; | |
return $this; | |
} | |
/** | |
* Get title | |
* | |
* @return string | |
*/ | |
public function getTitle() | |
{ | |
return $this->title; | |
} | |
/** | |
* Set description | |
* | |
* @param string $description | |
* @return DvdDescription | |
*/ | |
public function setDescription($description) | |
{ | |
$this->description = $description; | |
return $this; | |
} | |
/** | |
* Get description | |
* | |
* @return string | |
*/ | |
public function getDescription() | |
{ | |
return $this->description; | |
} | |
/** | |
* Set dvd | |
* | |
* @param $dvd | |
* @return DvdDescription | |
*/ | |
public function setDvd(Dvd $dvd) | |
{ | |
$this->dvd = $dvd; | |
return $this; | |
} | |
/** | |
* Get dvd | |
* | |
* @return Dvd | |
*/ | |
public function getDvd() | |
{ | |
return $this->dvd; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment