Created
December 1, 2011 11:36
-
-
Save haswalt/1416060 to your computer and use it in GitHub Desktop.
Mapped Superclass example
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 UKWM\Bundle\DictionaryBundle\Entity; | |
use \Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\MappedSuperclass | |
*/ | |
class Definition | |
{ | |
/** | |
* @ORM\Column(type="string", length="255") | |
*/ | |
protected $text; | |
/** | |
* @ORM\ManyToOne(targetEntity="Definition", inversedBy="alternatives") | |
* @ORM\JoinColumn(name="definition_id", referencedColumnName="id") | |
*/ | |
protected $alternatives; | |
public function __construct() | |
{ | |
$this->alternatives = new \Doctrine\Common\Collections\ArrayCollection(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment