ResultSet\Simple delete method returns true when a constraint violation occurs if the model has a virtual FK defined #11133
Labels
need script to reproduce
Script is required to reproduce the issue
stale
Stale issue - automatically closed
Using Robots demo as the example;
If I have a Robots model, which is related to a Parts model via RobotsParts, and Robots has this relationship map;
if I do
I correctly get a PDOException
however
if I alter the Robots relationship map to define a virtual foreign key with a friendlier message, eg
then re-run
$robots->delete() returns true, even though $robots->getMessages() has the FK message I defined. The actual database records are still correctly in place.
I would expect $robots->delete() to return false if any of the contained records fail to delete, in the same way as calling
will return false with the same FK violation.
The text was updated successfully, but these errors were encountered: