How do I use the cascade option in Symfony2 Doctrine?
问题 I'm trying to understand the cascade option in Doctrine in Symfony2 . I would like to be able to delete a child entity (and not trigger the foreign key constraint error.) I have 3 entities: Report /** * @ORM\OneToMany(targetEntity="Response", mappedBy="report") */ protected $responses; /** * @ORM\OneToMany(targetEntity="Response", mappedBy="report") */ protected $sms; Response /** * @ORM\ManyToOne(targetEntity="Report", inversedBy="responses") */ protected $report; SMS /** * @ORM\ManyToOne