Answer the question
In order to leave comments, you need to log in
How to properly extend from entity model in Doctrine?
Greetings.
Tell me how to properly extend from the entity model in Symfony?
I have a base model:
/**
* @ORM\Entity(repositoryClass=DislocationRepository::class)
*/
class Dislocation
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
protected $id;
/**
* @ORM\Column(type="integer")
*/
protected $carNumber;
/**
* @Entity
*/
class DislocationDownloadingData extends Dislocation
/**
* Abstract base class to be extended by my entity classes with same fields
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @ORM\Entity(repositoryClass=DislocationRepository::class)
*/
class Dislocation
{
Answer the question
In order to leave comments, you need to log in
I need to inherit from this model in order to override current methods, such as displaying a date in a different format, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question