Skip to content

Instantly share code, notes, and snippets.

@haswalt
Created December 1, 2011 11:37
Show Gist options
  • Save haswalt/1416066 to your computer and use it in GitHub Desktop.
Save haswalt/1416066 to your computer and use it in GitHub Desktop.
Subclass from Mapped superclass example
<?php
namespace UKWM\Bundle\DictionaryBundle\Entity;
use \Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="dictionary_colours", indexes={
* @ORM\Index(name="text_idx", columns={"text"})
* })
*/
class Colour extends Definition
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length="255")
*/
protected $text;
/**
* @ORM\ManyToOne(targetEntity="Definition", inversedBy="alternatives")
* @ORM\JoinColumn(name="definition_id", referencedColumnName="id")
*/
protected $alternatives;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment