In order to preserve how $event->isValid value setted by others componets/behaviours, it's better to change:
public function beforeSaveStatus($event)
{
$event->isValid = $this->sendToStatusInternal($this->getOwnerStatus(), true);
}
public function beforeDelete($event)
{
$event->isValid = $this->sendToStatusInternal(null, true);
}
to
$event->isValid&= $this->......
In my situation, i have a softdelete behaviour that set $event->isValid to FALSE to preserve the record, but SimpleWorkflowBehavior set it to TRUE!
In order to preserve how $event->isValid value setted by others componets/behaviours, it's better to change:
to
$event->isValid&= $this->......
In my situation, i have a softdelete behaviour that set $event->isValid to FALSE to preserve the record, but SimpleWorkflowBehavior set it to TRUE!
And the record was really deleted..
Was it the best way to solve this problem?