Created
May 21, 2014 01:24
-
-
Save kfuchs/08faaebdeffe654e7765 to your computer and use it in GitHub Desktop.
Revisions
-
kfuchs revised this gist
May 21, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,6 @@ class Dvd private $id; /** * * @Assert\Valid * @Assert\NotBlank() -
kfuchs created this gist
May 21, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ /** * 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; /** * @var \Nudeflix\Bundle\ContentBundle\Entity\DvdDescription * * @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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,102 @@ /** * 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; } }