With this two entities
Entity\AbstractSurveyAnswer:
type: entity
table: survey_answers
inheritanceType: JOINED
discriminatorColumn:
name: type_class
type: string
discriminatorMap:
database: SurveyDatabaseAnswer
client_text: SurveyClientTextAnswer
client_number: SurveyClientNumberAnswer
client_date: SurveyClientDateAnswer
id:
id:
type: integer
generator:
strategy: AUTO
manyToOne:
client:
targetEntity: Entity\Client
joinColumn:
name: id_client
nullable: false
referenceColumnName: id
survey:
targetEntity: Entity\AbstractSurvey
joinColumn:
name: id_survey
nullable: false
referenceColumnName: id
and
Entity\AbstractSurveyAnswer:
type: entity
table: survey_answers
inheritanceType: JOINED
discriminatorColumn:
name: type_class
type: string
discriminatorMap:
database: SurveyDatabaseAnswer
client_text: SurveyClientTextAnswer
client_number: SurveyClientNumberAnswer
client_date: SurveyClientDateAnswer
id:
id:
type: integer
generator:
strategy: AUTO
manyToOne:
client:
targetEntity: Entity\Client
joinColumn:
name: id_client
nullable: false
referenceColumnName: id
survey:
targetEntity: Entity\AbstractSurvey
joinColumn:
name: id_survey
nullable: false
referenceColumnName: id
and I try to remove an entity with this code
$to_delete_answer = new SurveyDatabaseAnswer();
$to_delete_answer->setId($answer);
$storage->remove($to_delete_answer);//calls EntityManagger::remove
$storage->flush();
But I get the followint error message
Detached entity \Entity\\SurveyDatabaseAnswer@00000000204763e700007fdd1d66d304 cannot be removed
I don't know what is wrong with delete this entities,not tryng trying to remove ant table referenced on another table.It's someething due the inheritance type?I'm noob on doctrine and I can't see the problem