I have this entity:
class FabricanteProductoSolicitud
{
use IdentifierAutogeneratedEntityTrait;
/**
* @ORM\ManyToOne(targetEntity="FabricanteDistribuidor",
cascade={"persist", "remove"})
* @ORM\JoinColumn(name="fabricante_distribuidor_id",
referencedColumnName="id")
*/
protected $fabricante_distribuidor;
/**
* @ORM\ManyToOne(targetEntity="ProductoSolicitud",
cascade={"persist"})
* @ORM\JoinColumn(name="producto_solicitud_id",
referencedColumnName="id")
*/
protected $producto_solicitud;
/**
* @ORM\ManyToMany(targetEntity="Pais",
inversedBy="fabricanteProductoSolicitudPais", cascade={"persist", "remove"})
*
@ORM\JoinTable(name="nomencladores.pais_fabricante_producto_solicitud",
schema="nomencladores",
*
joinColumns={@ORM\JoinColumn(name="fabricante_producto_solicitud_id",
referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="pais_id",
referencedColumnName="id")}
* )
*/
protected $paisesFabricanteProductoSolicitudPais;
/**
* @ORM\ManyToMany(targetEntity="ModeloMarcaProducto",
inversedBy="modeloMarcaProducto", cascade={"persist", "remove"})
* @ORM\JoinTable(name="negocio.fabricante_modelo_marca_producto",
schema="negocio",
*
joinColumns={@ORM\JoinColumn(name="fabricante_producto_solicitud_id",
referencedColumnName="id")},
*
inverseJoinColumns={@ORM\JoinColumn(name="modelo_marca_producto_id",
referencedColumnName="id")}
* )
*/
protected $fabricanteModeloMarcaProducto;
}
Any time I try to REMOVE|DELETE a record from a top entity using CASCADE
options I got this error:
"""
An exception occurred while executing 'DELETE FROM
negocio.solicitud_usuario WHERE id = ?' with params [18]:
SQLSTATE[23503]: Foreign key violation: 7 ERROR: update or delete on
table "fabricante_producto_solicitud" violates foreign key constraint
"fkfabricante563900" on table "fabricante_modelo_marca_producto"
DETAIL: Key (id)=(37) is still referenced from table
"fabricante_modelo_marca_producto"."""
Shouldn't cascade={"persist","remove"} deletes on CASCADE?
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.