Код: Выделить всё
use Doctrine\ORM\Mapping as ORM;
/**
* @Orm\MappedSuperclass
*/
class Object
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
}
/**
* @Orm\MappedSuperclass
*/
class Book extends Object
{
}
Код: Выделить всё
[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'id' on entity 'Name\SiteBundle\Entity\Book' in a field or discriminator column mapping.
Код: Выделить всё
/**
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"object" = "Object", "book" = "Book"})
*/
Подробнее здесь: https://stackoverflow.com/questions/194 ... discrimina