model->delete() not returning boolean value

I can’t tell if it is my programming or a bug in the framework, I expect that the delete method will return true or false depending on the success of the operation.

The code works as intended (it deletes the rows) but my code dies because error flags are being set.

$errs = 0;

// there can be quite a few rows that match these conditions so I delete them in a loop

foreach ($eventRecords as $record){


       if( $transactionRecord->delete()){

        // All good			

			} else; {




// now check if we had errors

if($errs > 0){

die("There were $errs errors ");

} else {



this doesn’t work either

if( !$transactionRecord->delete()){


so I am confused :blink: doodle

You have a semicolon after else.



thanks man, long day!

Oh the shame! :-[