As documented here: If you override the beforeSave($event)
method in a CActiveRecordBehavior
, you have to set the isValid
property of the $event
to false, if you want to prevent saving of the owner model.
if($preventSave) {
$event->isValid = false;
}
Also note, that it's $model->errors
, not $model->validationErrors
.