I am with a project in Symfony3 and in which I want to do inheritance between the entities by annotation yml. Would Property (Father), (Children) Housing and Garage
I have three yml files:
File 1
Ar\Soft\Alquileres\ModelBundle\Entity\Inmueble\Inmueble:
type: entity
table: null
repositoryClass: Ar\Soft\Alquileres\ModelBundle\Repository\InmuebleRepository
inheritanceType: SINGLE_TABLE
discriminatorColumn:
name: tipo
type: string
discriminatorMap:
vivienda: Vivienda
cochera: Cochera
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
valorDeCompra:
type: float
nullable: true
column: valor_de_compra
fechaDeCompra:
type: date
nullable: true
column: fecha_de_compra
disponible:
type: boolean
nullable: false
options:
default: true
numero:
type: integer
nullable: false
column: numero
superficie:
type: decimal
precision: 10
scale: 0
nullable: true
lifecycleCallbacks: { }
File 2
Ar\Soft\Alquileres\ModelBundle\Entity\Inmueble\Vivienda:
type: entity
table: null
repositoryClass: Ar\Soft\Alquileres\ModelBundle\Repository\ViviendaRepository
fields:
patio:
type: boolean
nullable: false
options:
default: false
lifecycleCallbacks: { }
File 3
Ar\Soft\Alquileres\ModelBundle\Entity\Inmueble\Cochera:
type: entity
table: null
repositoryClass: Ar\Soft\Alquileres\ModelBundle\Repository\CocheraRepository
fields:
tipoDeTecho:
type: integer
column: tipo_de_techo
lifecycleCallbacks: { }
When running from the folder php console doctrine: generate: entities ModelBundle
I get an error in file 1 (Property) because you do not know Vivieda and Cochera when you try to analyze the field " discriminatorMap "
Thank you.